Commit c72f68ef authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

kernel: Fix model/stepping in GetSystemInfo.

wProcessorRevision is built from model and stepping.
parent 1e27e1d5
...@@ -157,7 +157,7 @@ static void create_registry_keys( const SYSTEM_INFO *info ) ...@@ -157,7 +157,7 @@ static void create_registry_keys( const SYSTEM_INFO *info )
/*TODO: report 64bit processors properly*/ /*TODO: report 64bit processors properly*/
RtlInitUnicodeString( &valueW, IdentifierW ); RtlInitUnicodeString( &valueW, IdentifierW );
sprintf( id, "x86 Family %d Model %d Stepping %d", sprintf( id, "x86 Family %d Model %d Stepping %d",
info->wProcessorLevel /*model and family are messed up*/, info->wProcessorLevel, info->wProcessorRevision); info->wProcessorLevel, HIBYTE(info->wProcessorRevision), LOBYTE(info->wProcessorRevision) );
RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 ); RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 );
NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) ); NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) );
...@@ -300,6 +300,26 @@ VOID WINAPI GetSystemInfo( ...@@ -300,6 +300,26 @@ VOID WINAPI GetSystemInfo(
if ((s=strchr(value,'\n'))) if ((s=strchr(value,'\n')))
*s='\0'; *s='\0';
if (!strcasecmp(line,"processor")) {
/* processor number counts up... */
unsigned int x;
if (sscanf(value,"%d",&x))
if (x+1>cachedsi.dwNumberOfProcessors)
cachedsi.dwNumberOfProcessors=x+1;
continue;
}
if (!strcasecmp(line,"model")) {
/* First part of wProcessorRevision */
int x;
if (sscanf(value,"%d",&x))
cachedsi.wProcessorRevision = cachedsi.wProcessorRevision | (x << 8);
continue;
}
/* 2.1 method */ /* 2.1 method */
if (!strcasecmp(line, "cpu family")) { if (!strcasecmp(line, "cpu family")) {
if (isdigit (value[0])) { if (isdigit (value[0])) {
...@@ -356,33 +376,12 @@ VOID WINAPI GetSystemInfo( ...@@ -356,33 +376,12 @@ VOID WINAPI GetSystemInfo(
} }
continue; continue;
} }
if (!strcasecmp(line,"fdiv_bug")) {
if (!strncasecmp(value,"yes",3))
PF[PF_FLOATING_POINT_PRECISION_ERRATA] = TRUE;
continue;
}
if (!strcasecmp(line,"fpu")) {
if (!strncasecmp(value,"no",2))
PF[PF_FLOATING_POINT_EMULATED] = TRUE;
continue;
}
if (!strcasecmp(line,"processor")) {
/* processor number counts up... */
unsigned int x;
if (sscanf(value,"%d",&x))
if (x+1>cachedsi.dwNumberOfProcessors)
cachedsi.dwNumberOfProcessors=x+1;
continue;
}
if (!strcasecmp(line,"stepping")) { if (!strcasecmp(line,"stepping")) {
/* Second part of wProcessorRevision */
int x; int x;
if (sscanf(value,"%d",&x)) if (sscanf(value,"%d",&x))
cachedsi.wProcessorRevision = x; cachedsi.wProcessorRevision = cachedsi.wProcessorRevision | x;
continue; continue;
} }
...@@ -395,9 +394,20 @@ VOID WINAPI GetSystemInfo( ...@@ -395,9 +394,20 @@ VOID WINAPI GetSystemInfo(
} }
continue; continue;
} }
if (!strcasecmp(line,"fdiv_bug")) {
if (!strncasecmp(value,"yes",3))
PF[PF_FLOATING_POINT_PRECISION_ERRATA] = TRUE;
continue;
}
if (!strcasecmp(line,"fpu")) {
if (!strncasecmp(value,"no",2))
PF[PF_FLOATING_POINT_EMULATED] = TRUE;
continue;
}
if ( !strcasecmp(line,"flags") || if ( !strcasecmp(line,"flags") ||
!strcasecmp(line,"features") !strcasecmp(line,"features")) {
) {
if (strstr(value,"cx8")) if (strstr(value,"cx8"))
PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE; PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
if (strstr(value,"mmx")) if (strstr(value,"mmx"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment