From 85147ee96d02c35b99aba4307c8d0234199525ab Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 30 Jun 2003 18:28:08 +0000 Subject: [PATCH] Added PF_PAE_ENABLED and PF_XMMI64_INSTRUCTIONS defines. Detect them and 3DNOW and XMMI_INSTRUCTIONS for Linux. --- include/winnt.h | 4 +++- misc/cpu.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/winnt.h b/include/winnt.h index bc437cf2a40..2592b694612 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -506,8 +506,10 @@ typedef struct _SINGLE_LIST_ENTRY { #define PF_PPC_MOVEMEM_64BIT_OK 4 #define PF_ALPHA_BYTE_INSTRUCTIONS 5 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6 -#define PF_AMD3D_INSTRUCTIONS_AVAILABLE 7 +#define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8 +#define PF_PAE_ENABLED 9 +#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10 /* Execution state flags */ diff --git a/misc/cpu.c b/misc/cpu.c index e04b83326b8..5b4494ae95e 100644 --- a/misc/cpu.c +++ b/misc/cpu.c @@ -315,6 +315,16 @@ VOID WINAPI GetSystemInfo( PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE; if (strstr(value,"tsc")) PF[PF_RDTSC_INSTRUCTION_AVAILABLE] = TRUE; + if (strstr(value,"3dnow")) + PF[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = TRUE; + /* This will also catch sse2, but we have sse itself + * if we have sse2, so no problem */ + if (strstr(value,"sse")) + PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE; + if (strstr(value,"sse2")) + PF[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = TRUE; + if (strstr(value,"pae")) + PF[PF_PAE_ENABLED] = TRUE; } } @@ -455,7 +465,7 @@ VOID WINAPI GetSystemInfo( do_cpuid(0x80000000, regs); /* get vendor cpuid level */ if (regs[0]>=0x80000001) { do_cpuid(0x80000001, regs2); /* get vendor features */ - PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = + PF[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] & (1 << 31 )) >> 31; } }