wok rev 19642

linld: fix cpuhaslm
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jan 21 09:21:18 2017 +0100 (2017-01-21)
parents 2dad74422e4c
children d0b4145ad77c
files linld/stuff/src/CRTLX.ASM
line diff
     1.1 --- a/linld/stuff/src/CRTLX.ASM	Fri Jan 20 16:48:53 2017 +0000
     1.2 +++ b/linld/stuff/src/CRTLX.ASM	Sat Jan 21 09:21:18 2017 +0100
     1.3 @@ -91,6 +91,9 @@
     1.4          endp    _strstr
     1.5  
     1.6  
     1.7 +macro   cpuid
     1.8 +        db      0fh,0A2h
     1.9 +endm
    1.10  ;***************************************************************
    1.11  ;int cpuhaslm(void)
    1.12  ;***************************************************************
    1.13 @@ -110,20 +113,18 @@
    1.14                  js     @@bad   		;it is a 86/186/286, not a 386+
    1.15                  p386
    1.16  		pushfd
    1.17 -		pushfd
    1.18  		pop	ebx
    1.19  		mov	ecx,ebx
    1.20 -		xor	ebx,00100000h	; toggle CPUID feature bit 21
    1.21 +		btc	ebx,21		; toggle CPUID feature bit 21
    1.22  		push	ebx
    1.23  		popfd
    1.24  		pushfd
    1.25  		pop	ebx
    1.26 -		popfd
    1.27  		xor	ebx,ecx
    1.28 -		shr	ebx,1+21	; CPUID feature bit ?
    1.29 +		shr	ebx,1+21	; CPUID feature bit changed ?
    1.30  		jnc	@@bad
    1.31  		mov	eax,80000001h	; Extended Processor Info and Feature Bits
    1.32 -		db	0Fh,0A2h	; cpuid
    1.33 +		cpuid
    1.34  		shr	edx,1+29	; LM feature bit ?
    1.35  @@bad:
    1.36                  p8086