summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
Diffstat (limited to 'loader')
-rw-r--r--loader/stubs.s16
-rw-r--r--loader/win32.c27
2 files changed, 24 insertions, 19 deletions
diff --git a/loader/stubs.s b/loader/stubs.s
index dd2d5db931..d2ca312594 100644
--- a/loader/stubs.s
+++ b/loader/stubs.s
@@ -1,13 +1,7 @@
- .file "stubs.c"
- .version "01.01"
-gcc2_compiled.:
-.section .rodata
-.LC0:
- .string "Called unk_%s\n"
-.data
+ .data
+.LC0: .string "Called unk_%s\n"
.align 4
.globl unk_exp1
- .type unk_exp1,@function
unk_exp1:
pushl %ebp
movl %esp,%ebp
@@ -26,11 +20,5 @@ unk_exp1:
call printf
addl $8,%esp
xorl %eax,%eax
- jmp .L1
- .align 4
-.L1:
leave
ret
-.Lfe1:
- .size unk_exp1,.Lfe1-unk_exp1
- .ident "GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)"
diff --git a/loader/win32.c b/loader/win32.c
index 105f8afc1f..323c99b1ad 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -702,12 +702,29 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
cachedsi.wProcessorLevel = 5; /* pentium */
cachedsi.wProcessorRevision = 0x0101;
-#if defined(__FreeBSD__) || defined(__NetBSD__)
- cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
- cachedsi.wProcessorLevel= 5;
- PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__)
do_cpuid(regs);
- if (regs[3] & 0x00800000)
+ switch ((regs[0] >> 8) & 0xf) { // cpu family
+ case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
+ cachedsi.wProcessorLevel= 3;
+ break;
+ case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
+ cachedsi.wProcessorLevel= 4;
+ break;
+ case 5: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
+ cachedsi.wProcessorLevel= 5;
+ break;
+ case 6: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
+ cachedsi.wProcessorLevel= 5;
+ break;
+ default:cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
+ cachedsi.wProcessorLevel= 5;
+ break;
+ }
+ cachedsi.wProcessorRevision = regs[0] & 0xf; // stepping
+ if (regs[3] & (1 << 8))
+ PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
+ if (regs[3] & (1 << 23))
PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
cachedsi.dwNumberOfProcessors=1;
#else