From 761e5e8ae737f6ca3c8854ffd3aa14bbace10ea2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 5 Jan 2006 07:08:59 +0000 Subject: [PATCH] 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 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/hermes/x86_main.asm b/src/hermes/x86_main.asm index afe02b586..92103a697 100644 --- a/src/hermes/x86_main.asm +++ b/src/hermes/x86_main.asm @@ -16,11 +16,6 @@ GLOBAL _x86return GLOBAL _Hermes_X86_CPU -SECTION .data - -cpu_flags dd 0 - - SECTION .text ;; _ConvertX86: @@ -109,16 +104,13 @@ _Hermes_X86_CPU: xor eax,ecx je .L1 - pusha - + push ebx + mov eax,1 cpuid + mov eax,edx - mov [cpu_flags],edx - - popa - - mov eax,[cpu_flags] + pop ebx .L1: ret