# HG changeset patch # User Pascal Bellard # Date 1484986878 -3600 # Node ID d90896f9d59ecca4e190fccf6438b716474f6ce5 # Parent 2dad74422e4cabb2f5711b90de14df400c110074 linld: fix cpuhaslm diff -r 2dad74422e4c -r d90896f9d59e linld/stuff/src/CRTLX.ASM --- a/linld/stuff/src/CRTLX.ASM Fri Jan 20 16:48:53 2017 +0000 +++ b/linld/stuff/src/CRTLX.ASM Sat Jan 21 09:21:18 2017 +0100 @@ -91,6 +91,9 @@ endp _strstr +macro cpuid + db 0fh,0A2h +endm ;*************************************************************** ;int cpuhaslm(void) ;*************************************************************** @@ -110,20 +113,18 @@ js @@bad ;it is a 86/186/286, not a 386+ p386 pushfd - pushfd pop ebx mov ecx,ebx - xor ebx,00100000h ; toggle CPUID feature bit 21 + btc ebx,21 ; toggle CPUID feature bit 21 push ebx popfd pushfd pop ebx - popfd xor ebx,ecx - shr ebx,1+21 ; CPUID feature bit ? + shr ebx,1+21 ; CPUID feature bit changed ? jnc @@bad mov eax,80000001h ; Extended Processor Info and Feature Bits - db 0Fh,0A2h ; cpuid + cpuid shr edx,1+29 ; LM feature bit ? @@bad: p8086