From Mike Frysinger and/or Gentoo:
authorRyan C. Gordon <icculus@icculus.org>
Thu, 05 Jan 2006 07:08:59 +0000
changeset 12273202d727bb4b
parent 1226 d05306f0dc21
child 1228 f4a3a4129d04
From Mike Frysinger and/or Gentoo:

- libsdl-PIC-hermes-cpuid.patch
rewrites the code in _Hermes_X86_CPU so that it doesnt require the local
cpu_flags memory variable, it just uses registers.
test case: http://dev.gentoo.org/~vapier/libsdl/hermes-cpuid-test.tar.bz2
src/hermes/x86_main.asm
     1.1 --- a/src/hermes/x86_main.asm	Wed Jan 04 22:57:50 2006 +0000
     1.2 +++ b/src/hermes/x86_main.asm	Thu Jan 05 07:08:59 2006 +0000
     1.3 @@ -16,11 +16,6 @@
     1.4  	
     1.5  GLOBAL _Hermes_X86_CPU
     1.6  
     1.7 -SECTION .data
     1.8 -	
     1.9 -cpu_flags dd 0
    1.10 -	
    1.11 -		
    1.12  SECTION .text
    1.13  		
    1.14  ;; _ConvertX86:	 
    1.15 @@ -109,16 +104,13 @@
    1.16  	xor eax,ecx
    1.17  	je .L1
    1.18  	
    1.19 -	pusha
    1.20 -	
    1.21 +	push ebx
    1.22 +
    1.23  	mov eax,1
    1.24  	cpuid
    1.25 +	mov eax,edx
    1.26  
    1.27 -	mov [cpu_flags],edx
    1.28 -
    1.29 -	popa
    1.30 -
    1.31 -	mov eax,[cpu_flags]
    1.32 +	pop ebx
    1.33  
    1.34  .L1:	
    1.35  	ret