Skip to content

Commit 537e842

Browse files
authored
Merge pull request #85 from tkchia/master
rtlib: fix some minor bugs in fb_CpuDetect for x86
2 parents d20a63b + 4cbb1a9 commit 537e842

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rtlib/x86/cpudetect.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ detect:
4747
/* no CPUID; assume 386 and check if 486 (try toggling bit 18 (AC) of EFLAGS) */
4848
mov ebx, 0x30000000
4949
mov ecx, esp
50-
and esp, 0xFFFFFFFB /* round ESP down to a multiple of 4 (must be aligned if AC becomes enabled) */
50+
and esp, 0xFFFFFFFC /* round ESP down to a multiple of 4 (must be aligned if AC becomes enabled) */
5151
pushfd
5252
pop eax
5353
mov edx, eax
@@ -71,6 +71,7 @@ cpu486_not_found:
7171
cpuid_ok:
7272
mov eax, 1
7373
cpuid
74+
mov al, 0
7475
shl eax, 20
7576
and edx, 0x0FFFFFFF /* low 28 bits of feature flags */
7677
or eax, edx

0 commit comments

Comments
 (0)