comparison src/hermes/x86_main.asm @ 1227:3202d727bb4b

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
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 05 Jan 2006 07:08:59 +0000
parents 2d6dc7de1145
children 393092a3ebf6
comparison
equal deleted inserted replaced
1226:d05306f0dc21 1227:3202d727bb4b
14 GLOBAL _ConvertX86 14 GLOBAL _ConvertX86
15 GLOBAL _x86return 15 GLOBAL _x86return
16 16
17 GLOBAL _Hermes_X86_CPU 17 GLOBAL _Hermes_X86_CPU
18 18
19 SECTION .data
20
21 cpu_flags dd 0
22
23
24 SECTION .text 19 SECTION .text
25 20
26 ;; _ConvertX86: 21 ;; _ConvertX86:
27 ;; [ESP+8] ConverterInfo* 22 ;; [ESP+8] ConverterInfo*
28 ;; -------------------------------------------------------------------------- 23 ;; --------------------------------------------------------------------------
107 102
108 pop eax 103 pop eax
109 xor eax,ecx 104 xor eax,ecx
110 je .L1 105 je .L1
111 106
112 pusha 107 push ebx
113 108
114 mov eax,1 109 mov eax,1
115 cpuid 110 cpuid
111 mov eax,edx
116 112
117 mov [cpu_flags],edx 113 pop ebx
118
119 popa
120
121 mov eax,[cpu_flags]
122 114
123 .L1: 115 .L1:
124 ret 116 ret
125 117
126 %ifidn __OUTPUT_FORMAT__,elf 118 %ifidn __OUTPUT_FORMAT__,elf