Commit 7cdb88a5 authored by Alexandre Julliard's avatar Alexandre Julliard

include: Update the SYSTEM_PROCESS_INFORMATION structure.

Spotted by Alex Henrie. Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1331a8ea
...@@ -109,7 +109,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si ) ...@@ -109,7 +109,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
&cpu_info, sizeof(cpu_info), NULL ))) &cpu_info, sizeof(cpu_info), NULL )))
return; return;
si->u.s.wProcessorArchitecture = cpu_info.Architecture; si->u.s.wProcessorArchitecture = cpu_info.ProcessorArchitecture;
si->u.s.wReserved = 0; si->u.s.wReserved = 0;
si->dwPageSize = basic_info.PageSize; si->dwPageSize = basic_info.PageSize;
si->lpMinimumApplicationAddress = basic_info.LowestUserAddress; si->lpMinimumApplicationAddress = basic_info.LowestUserAddress;
...@@ -117,13 +117,13 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si ) ...@@ -117,13 +117,13 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwActiveProcessorMask = basic_info.ActiveProcessorsAffinityMask; si->dwActiveProcessorMask = basic_info.ActiveProcessorsAffinityMask;
si->dwNumberOfProcessors = basic_info.NumberOfProcessors; si->dwNumberOfProcessors = basic_info.NumberOfProcessors;
si->dwAllocationGranularity = basic_info.AllocationGranularity; si->dwAllocationGranularity = basic_info.AllocationGranularity;
si->wProcessorLevel = cpu_info.Level; si->wProcessorLevel = cpu_info.ProcessorLevel;
si->wProcessorRevision = cpu_info.Revision; si->wProcessorRevision = cpu_info.ProcessorRevision;
switch (cpu_info.Architecture) switch (cpu_info.ProcessorArchitecture)
{ {
case PROCESSOR_ARCHITECTURE_INTEL: case PROCESSOR_ARCHITECTURE_INTEL:
switch (cpu_info.Level) switch (cpu_info.ProcessorLevel)
{ {
case 3: si->dwProcessorType = PROCESSOR_INTEL_386; break; case 3: si->dwProcessorType = PROCESSOR_INTEL_386; break;
case 4: si->dwProcessorType = PROCESSOR_INTEL_486; break; case 4: si->dwProcessorType = PROCESSOR_INTEL_486; break;
...@@ -133,7 +133,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si ) ...@@ -133,7 +133,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
} }
break; break;
case PROCESSOR_ARCHITECTURE_PPC: case PROCESSOR_ARCHITECTURE_PPC:
switch (cpu_info.Level) switch (cpu_info.ProcessorLevel)
{ {
case 1: si->dwProcessorType = PROCESSOR_PPC_601; break; case 1: si->dwProcessorType = PROCESSOR_PPC_601; break;
case 3: case 3:
...@@ -148,7 +148,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si ) ...@@ -148,7 +148,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwProcessorType = PROCESSOR_AMD_X8664; si->dwProcessorType = PROCESSOR_AMD_X8664;
break; break;
case PROCESSOR_ARCHITECTURE_ARM: case PROCESSOR_ARCHITECTURE_ARM:
switch (cpu_info.Level) switch (cpu_info.ProcessorLevel)
{ {
case 4: si->dwProcessorType = PROCESSOR_ARM_7TDMI; break; case 4: si->dwProcessorType = PROCESSOR_ARM_7TDMI; break;
default: si->dwProcessorType = PROCESSOR_ARM920; default: si->dwProcessorType = PROCESSOR_ARM920;
...@@ -158,7 +158,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si ) ...@@ -158,7 +158,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwProcessorType = 0; si->dwProcessorType = 0;
break; break;
default: default:
FIXME( "Unknown processor architecture %x\n", cpu_info.Architecture ); FIXME( "Unknown processor architecture %x\n", cpu_info.ProcessorArchitecture );
si->dwProcessorType = 0; si->dwProcessorType = 0;
break; break;
} }
......
...@@ -208,8 +208,9 @@ static void test_query_cpu(void) ...@@ -208,8 +208,9 @@ static void test_query_cpu(void)
ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength); ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
/* Check if we have some return values */ /* Check if we have some return values */
if (winetest_debug > 1) trace("Processor FeatureSet : %08x\n", sci.FeatureSet); if (winetest_debug > 1) trace("Processor FeatureSet : %08x\n", sci.ProcessorFeatureBits);
ok( sci.FeatureSet != 0, "Expected some features for this processor, got %08x\n", sci.FeatureSet); ok( sci.ProcessorFeatureBits != 0, "Expected some features for this processor, got %08x\n",
sci.ProcessorFeatureBits);
} }
static void test_query_performance(void) static void test_query_performance(void)
......
...@@ -847,7 +847,7 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si ...@@ -847,7 +847,7 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si
context->ContextFlags |= CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS; context->ContextFlags |= CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS;
memcpy( context->ExtendedRegisters, fpux, sizeof(*fpux) ); memcpy( context->ExtendedRegisters, fpux, sizeof(*fpux) );
if (!fpu) fpux_to_fpu( &context->FloatSave, fpux ); if (!fpu) fpux_to_fpu( &context->FloatSave, fpux );
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = XState_sig(fpux))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(fpux)))
{ {
context_init_xstate( context, xs ); context_init_xstate( context, xs );
xcontext->host_compaction_mask = xs->CompactionMask; xcontext->host_compaction_mask = xs->CompactionMask;
...@@ -975,11 +975,11 @@ void signal_restore_full_cpu_context(void) ...@@ -975,11 +975,11 @@ void signal_restore_full_cpu_context(void)
{ {
struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() ); struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() );
if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE)
{ {
__asm__ volatile( "xrstor %0" : : "m"(*xsave), "a" (7), "d" (0) ); __asm__ volatile( "xrstor %0" : : "m"(*xsave), "a" (7), "d" (0) );
} }
else if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR)
{ {
__asm__ volatile( "fxrstor %0" : : "m"(xsave->u.xsave) ); __asm__ volatile( "fxrstor %0" : : "m"(xsave->u.xsave) );
} }
...@@ -1230,7 +1230,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) ...@@ -1230,7 +1230,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
else if (flags & CONTEXT_FLOATING_POINT) else if (flags & CONTEXT_FLOATING_POINT)
{ {
struct syscall_xsave *xsave = get_syscall_xsave( frame ); struct syscall_xsave *xsave = get_syscall_xsave( frame );
if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR)
{ {
fpu_to_fpux( &xsave->u.xsave, &context->FloatSave ); fpu_to_fpux( &xsave->u.xsave, &context->FloatSave );
} }
...@@ -1240,7 +1240,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) ...@@ -1240,7 +1240,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
} }
xsave->xstate.mask |= XSTATE_MASK_LEGACY_FLOATING_POINT; xsave->xstate.mask |= XSTATE_MASK_LEGACY_FLOATING_POINT;
} }
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = xstate_from_context( context ))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = xstate_from_context( context )))
{ {
struct syscall_xsave *xsave = get_syscall_xsave( frame ); struct syscall_xsave *xsave = get_syscall_xsave( frame );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
...@@ -1326,7 +1326,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) ...@@ -1326,7 +1326,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
} }
if (needed_flags & CONTEXT_FLOATING_POINT) if (needed_flags & CONTEXT_FLOATING_POINT)
{ {
if (!(cpu_info.FeatureSet & CPU_FEATURE_FXSR)) if (!(cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR))
{ {
context->FloatSave = xsave->u.fsave; context->FloatSave = xsave->u.fsave;
} }
...@@ -1385,7 +1385,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) ...@@ -1385,7 +1385,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
x86_thread_data()->dr6 = context->Dr6; x86_thread_data()->dr6 = context->Dr6;
x86_thread_data()->dr7 = context->Dr7; x86_thread_data()->dr7 = context->Dr7;
} }
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xstate = xstate_from_context( context ))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xstate = xstate_from_context( context )))
{ {
struct syscall_xsave *xsave = get_syscall_xsave( frame ); struct syscall_xsave *xsave = get_syscall_xsave( frame );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
...@@ -2573,9 +2573,9 @@ void *signal_init_syscalls(void) ...@@ -2573,9 +2573,9 @@ void *signal_init_syscalls(void)
if (xstate_compaction_enabled) if (xstate_compaction_enabled)
syscall_dispatcher = __wine_syscall_dispatcher_xsavec; syscall_dispatcher = __wine_syscall_dispatcher_xsavec;
else if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE)
syscall_dispatcher = __wine_syscall_dispatcher_xsave; syscall_dispatcher = __wine_syscall_dispatcher_xsave;
else if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR)
syscall_dispatcher = __wine_syscall_dispatcher_fxsave; syscall_dispatcher = __wine_syscall_dispatcher_fxsave;
else else
syscall_dispatcher = __wine_syscall_dispatcher; syscall_dispatcher = __wine_syscall_dispatcher;
......
...@@ -1528,7 +1528,7 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex ...@@ -1528,7 +1528,7 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
context->ContextFlags |= CONTEXT_FLOATING_POINT; context->ContextFlags |= CONTEXT_FLOATING_POINT;
context->u.FltSave = *FPU_sig(sigcontext); context->u.FltSave = *FPU_sig(sigcontext);
context->MxCsr = context->u.FltSave.MxCsr; context->MxCsr = context->u.FltSave.MxCsr;
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext)))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext))))
{ {
/* xcontext and sigcontext are both on the signal stack, so we can /* xcontext and sigcontext are both on the signal stack, so we can
* just reference sigcontext without overflowing 32 bit XState.Offset */ * just reference sigcontext without overflowing 32 bit XState.Offset */
...@@ -1558,7 +1558,7 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon ...@@ -1558,7 +1558,7 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon
amd64_thread_data()->dr7 = context->Dr7; amd64_thread_data()->dr7 = context->Dr7;
set_sigcontext( context, sigcontext ); set_sigcontext( context, sigcontext );
if (FPU_sig(sigcontext)) *FPU_sig(sigcontext) = context->u.FltSave; if (FPU_sig(sigcontext)) *FPU_sig(sigcontext) = context->u.FltSave;
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext)))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = XState_sig(FPU_sig(sigcontext))))
xs->CompactionMask = xcontext->host_compaction_mask; xs->CompactionMask = xcontext->host_compaction_mask;
} }
...@@ -1600,7 +1600,7 @@ void signal_restore_full_cpu_context(void) ...@@ -1600,7 +1600,7 @@ void signal_restore_full_cpu_context(void)
{ {
struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() ); struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() );
if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE)
{ {
__asm__ volatile( "xrstor64 %0" : : "m"(xsave->xsave), "a" (7), "d" (0) ); __asm__ volatile( "xrstor64 %0" : : "m"(xsave->xsave), "a" (7), "d" (0) );
} }
...@@ -1907,7 +1907,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) ...@@ -1907,7 +1907,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
xsave->xsave = context->u.FltSave; xsave->xsave = context->u.FltSave;
xsave->xstate.Mask |= XSTATE_MASK_LEGACY; xsave->xstate.Mask |= XSTATE_MASK_LEGACY;
} }
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = xstate_from_context( context ))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xs = xstate_from_context( context )))
{ {
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
...@@ -2044,7 +2044,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) ...@@ -2044,7 +2044,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
amd64_thread_data()->dr6 = context->Dr6; amd64_thread_data()->dr6 = context->Dr6;
amd64_thread_data()->dr7 = context->Dr7; amd64_thread_data()->dr7 = context->Dr7;
} }
if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xstate = xstate_from_context( context ))) if ((cpu_info.ProcessorFeatureBits & CPU_FEATURE_AVX) && (xstate = xstate_from_context( context )))
{ {
struct syscall_xsave *xsave = get_syscall_xsave( frame ); struct syscall_xsave *xsave = get_syscall_xsave( frame );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1); CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
...@@ -2895,7 +2895,7 @@ void *signal_init_syscalls(void) ...@@ -2895,7 +2895,7 @@ void *signal_init_syscalls(void)
if (xstate_compaction_enabled) if (xstate_compaction_enabled)
syscall_dispatcher = __wine_syscall_dispatcher_xsavec; syscall_dispatcher = __wine_syscall_dispatcher_xsavec;
else if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE)
syscall_dispatcher = __wine_syscall_dispatcher_xsave; syscall_dispatcher = __wine_syscall_dispatcher_xsave;
else else
syscall_dispatcher = __wine_syscall_dispatcher; syscall_dispatcher = __wine_syscall_dispatcher;
......
...@@ -2129,11 +2129,11 @@ typedef struct _SYSTEM_BASIC_INFORMATION { ...@@ -2129,11 +2129,11 @@ typedef struct _SYSTEM_BASIC_INFORMATION {
/* System Information Class 0x01 */ /* System Information Class 0x01 */
typedef struct _SYSTEM_CPU_INFORMATION { typedef struct _SYSTEM_CPU_INFORMATION {
WORD Architecture; USHORT ProcessorArchitecture;
WORD Level; USHORT ProcessorLevel;
WORD Revision; /* combination of CPU model and stepping */ USHORT ProcessorRevision;
WORD Reserved; /* always zero */ USHORT MaximumProcessors;
DWORD FeatureSet; /* see bit flags below */ ULONG ProcessorFeatureBits;
} SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION; } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
/* definitions of bits in the Feature set for the x86 processors */ /* definitions of bits in the Feature set for the x86 processors */
......
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