From 4cbb1a908287ca0d33c7cb6fc7fbf72097e2c3b3 Mon Sep 17 00:00:00 2001 From: Tee-Kiah Chia Date: Sat, 26 May 2018 02:04:03 +0800 Subject: [PATCH] rtlib: fix some minor bugs in fb_CpuDetect for x86 --- src/rtlib/x86/cpudetect.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rtlib/x86/cpudetect.s b/src/rtlib/x86/cpudetect.s index 98b7b626a8..d01bb17779 100644 --- a/src/rtlib/x86/cpudetect.s +++ b/src/rtlib/x86/cpudetect.s @@ -47,7 +47,7 @@ detect: /* no CPUID; assume 386 and check if 486 (try toggling bit 18 (AC) of EFLAGS) */ mov ebx, 0x30000000 mov ecx, esp - and esp, 0xFFFFFFFB /* round ESP down to a multiple of 4 (must be aligned if AC becomes enabled) */ + and esp, 0xFFFFFFFC /* round ESP down to a multiple of 4 (must be aligned if AC becomes enabled) */ pushfd pop eax mov edx, eax @@ -71,6 +71,7 @@ cpu486_not_found: cpuid_ok: mov eax, 1 cpuid + mov al, 0 shl eax, 20 and edx, 0x0FFFFFFF /* low 28 bits of feature flags */ or eax, edx