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 )
&cpu_info, sizeof(cpu_info), NULL )))
return;
si->u.s.wProcessorArchitecture = cpu_info.Architecture;
si->u.s.wProcessorArchitecture = cpu_info.ProcessorArchitecture;
si->u.s.wReserved = 0;
si->dwPageSize = basic_info.PageSize;
si->lpMinimumApplicationAddress = basic_info.LowestUserAddress;
......@@ -117,13 +117,13 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwActiveProcessorMask = basic_info.ActiveProcessorsAffinityMask;
si->dwNumberOfProcessors = basic_info.NumberOfProcessors;
si->dwAllocationGranularity = basic_info.AllocationGranularity;
si->wProcessorLevel = cpu_info.Level;
si->wProcessorRevision = cpu_info.Revision;
si->wProcessorLevel = cpu_info.ProcessorLevel;
si->wProcessorRevision = cpu_info.ProcessorRevision;
switch (cpu_info.Architecture)
switch (cpu_info.ProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_INTEL:
switch (cpu_info.Level)
switch (cpu_info.ProcessorLevel)
{
case 3: si->dwProcessorType = PROCESSOR_INTEL_386; break;
case 4: si->dwProcessorType = PROCESSOR_INTEL_486; break;
......@@ -133,7 +133,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
}
break;
case PROCESSOR_ARCHITECTURE_PPC:
switch (cpu_info.Level)
switch (cpu_info.ProcessorLevel)
{
case 1: si->dwProcessorType = PROCESSOR_PPC_601; break;
case 3:
......@@ -148,7 +148,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwProcessorType = PROCESSOR_AMD_X8664;
break;
case PROCESSOR_ARCHITECTURE_ARM:
switch (cpu_info.Level)
switch (cpu_info.ProcessorLevel)
{
case 4: si->dwProcessorType = PROCESSOR_ARM_7TDMI; break;
default: si->dwProcessorType = PROCESSOR_ARM920;
......@@ -158,7 +158,7 @@ void WINAPI DECLSPEC_HOTPATCH GetSystemInfo( SYSTEM_INFO *si )
si->dwProcessorType = 0;
break;
default:
FIXME( "Unknown processor architecture %x\n", cpu_info.Architecture );
FIXME( "Unknown processor architecture %x\n", cpu_info.ProcessorArchitecture );
si->dwProcessorType = 0;
break;
}
......
......@@ -208,8 +208,9 @@ static void test_query_cpu(void)
ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
/* Check if we have some return values */
if (winetest_debug > 1) trace("Processor FeatureSet : %08x\n", sci.FeatureSet);
ok( sci.FeatureSet != 0, "Expected some features for this processor, got %08x\n", sci.FeatureSet);
if (winetest_debug > 1) trace("Processor FeatureSet : %08x\n", sci.ProcessorFeatureBits);
ok( sci.ProcessorFeatureBits != 0, "Expected some features for this processor, got %08x\n",
sci.ProcessorFeatureBits);
}
static void test_query_performance(void)
......
......@@ -847,7 +847,7 @@ static inline void save_context( struct xcontext *xcontext, const ucontext_t *si
context->ContextFlags |= CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS;
memcpy( context->ExtendedRegisters, fpux, sizeof(*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 );
xcontext->host_compaction_mask = xs->CompactionMask;
......@@ -975,11 +975,11 @@ void signal_restore_full_cpu_context(void)
{
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) );
}
else if (cpu_info.FeatureSet & CPU_FEATURE_FXSR)
else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR)
{
__asm__ volatile( "fxrstor %0" : : "m"(xsave->u.xsave) );
}
......@@ -1230,7 +1230,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
else if (flags & CONTEXT_FLOATING_POINT)
{
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 );
}
......@@ -1240,7 +1240,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
}
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 );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
......@@ -1326,7 +1326,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
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;
}
......@@ -1385,7 +1385,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
x86_thread_data()->dr6 = context->Dr6;
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 );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
......@@ -2573,9 +2573,9 @@ void *signal_init_syscalls(void)
if (xstate_compaction_enabled)
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;
else if (cpu_info.FeatureSet & CPU_FEATURE_FXSR)
else if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_FXSR)
syscall_dispatcher = __wine_syscall_dispatcher_fxsave;
else
syscall_dispatcher = __wine_syscall_dispatcher;
......
......@@ -1528,7 +1528,7 @@ static void save_context( struct xcontext *xcontext, const ucontext_t *sigcontex
context->ContextFlags |= CONTEXT_FLOATING_POINT;
context->u.FltSave = *FPU_sig(sigcontext);
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
* just reference sigcontext without overflowing 32 bit XState.Offset */
......@@ -1558,7 +1558,7 @@ static void restore_context( const struct xcontext *xcontext, ucontext_t *sigcon
amd64_thread_data()->dr7 = context->Dr7;
set_sigcontext( context, sigcontext );
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;
}
......@@ -1600,7 +1600,7 @@ void signal_restore_full_cpu_context(void)
{
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) );
}
......@@ -1907,7 +1907,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
xsave->xsave = context->u.FltSave;
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);
......@@ -2044,7 +2044,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
amd64_thread_data()->dr6 = context->Dr6;
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 );
CONTEXT_EX *context_ex = (CONTEXT_EX *)(context + 1);
......@@ -2895,7 +2895,7 @@ void *signal_init_syscalls(void)
if (xstate_compaction_enabled)
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;
else
syscall_dispatcher = __wine_syscall_dispatcher;
......
......@@ -2129,11 +2129,11 @@ typedef struct _SYSTEM_BASIC_INFORMATION {
/* System Information Class 0x01 */
typedef struct _SYSTEM_CPU_INFORMATION {
WORD Architecture;
WORD Level;
WORD Revision; /* combination of CPU model and stepping */
WORD Reserved; /* always zero */
DWORD FeatureSet; /* see bit flags below */
USHORT ProcessorArchitecture;
USHORT ProcessorLevel;
USHORT ProcessorRevision;
USHORT MaximumProcessors;
ULONG ProcessorFeatureBits;
} SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
/* 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