Missing pop over a jump
authorSam Lantinga <slouken@libsdl.org>
Thu, 03 Dec 2009 04:33:05 +0000
changeset 3515 d94e331e85fa
parent 3514 f0b7bc1fe12d
child 3516 72e70a8c30d5
Missing pop over a jump
src/cpuinfo/SDL_cpuinfo.c
--- a/src/cpuinfo/SDL_cpuinfo.c	Wed Dec 02 07:56:09 2009 +0000
+++ b/src/cpuinfo/SDL_cpuinfo.c	Thu Dec 03 04:33:05 2009 +0000
@@ -156,10 +156,12 @@
 "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
 "        pushl   %%ebx                                                 \n"
 "        cpuid                       # Get and save vendor ID          \n"
+"        popl    %%ebx                                                 \n"
 "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
 "        jl      1f                  # We dont have the CPUID instruction\n"
 "        xorl    %%eax,%%eax                                           \n"
 "        incl    %%eax                                                 \n"
+"        pushl   %%ebx                                                 \n"
 "        cpuid                       # Get family/model/stepping/features\n"
 "        popl    %%ebx                                                 \n"
 "        movl    %%edx,%0                                              \n"
@@ -171,14 +173,16 @@
 #elif defined(__GNUC__) && defined(__x86_64__)
 	__asm__ (
 "        xorl    %%eax,%%eax         # Set up for CPUID instruction    \n"
-"        pushq   %%rbx\n"
+"        pushq   %%rbx                                                 \n"
 "        cpuid                       # Get and save vendor ID          \n"
+"        popq    %%rbx                                                 \n"
 "        cmpl    $1,%%eax            # Make sure 1 is valid input for CPUID\n"
 "        jl      1f                  # We dont have the CPUID instruction\n"
 "        xorl    %%eax,%%eax                                           \n"
 "        incl    %%eax                                                 \n"
+"        pushq   %%rbx                                                 \n"
 "        cpuid                       # Get family/model/stepping/features\n"
-"        popq    %%rbx\n"
+"        popq    %%rbx                                                 \n"
 "        movl    %%edx,%0                                              \n"
 "1:                                                                    \n"
 	: "=m" (features)
@@ -190,10 +194,12 @@
         xor     eax, eax            ; Set up for CPUID instruction
         push    ebx
         cpuid                       ; Get and save vendor ID
+        pop     ebx
         cmp     eax, 1              ; Make sure 1 is valid input for CPUID
         jl      done                ; We dont have the CPUID instruction
         xor     eax, eax
         inc     eax
+        push    ebx
         cpuid                       ; Get family/model/stepping/features
         pop     ebx
         mov     features, edx
@@ -204,10 +210,12 @@
 "        xorl    %eax,%eax         \n"
 "        pushl   %ebx              \n"
 "        cpuid                     \n"
+"        popl    %ebx              \n"
 "        cmpl    $1,%eax           \n"
 "        jl      1f                \n"
 "        xorl    %eax,%eax         \n"
 "        incl    %eax              \n"
+"        pushl   %ebx              \n"
 "        cpuid                     \n"
 "        popl    %ebx              \n"
 #ifdef __i386
@@ -231,9 +239,11 @@
 "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
 "        pushl   %%ebx                                                 \n"
 "        cpuid                       # Get extended function limit     \n"
+"        popl    %%ebx                                                 \n"
 "        cmpl    $0x80000001,%%eax                                     \n"
 "        jl      1f                  # Nope, we dont have function 800000001h\n"
 "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
+"        pushl   %%ebx                                                 \n"
 "        cpuid                       # and get the information         \n"
 "        popl    %%ebx                                                 \n"
 "        movl    %%edx,%0                                              \n"
@@ -247,9 +257,11 @@
 "        movl    $0x80000000,%%eax   # Query for extended functions    \n"
 "        pushq   %%rbx                                                 \n"
 "        cpuid                       # Get extended function limit     \n"
+"        popq    %%rbx                                                 \n"
 "        cmpl    $0x80000001,%%eax                                     \n"
 "        jl      1f                  # Nope, we dont have function 800000001h\n"
 "        movl    $0x80000001,%%eax   # Setup extended function 800000001h\n"
+"        pushq   %%rbx                                                 \n"
 "        cpuid                       # and get the information         \n"
 "        popq    %%rbx                                                 \n"
 "        movl    %%edx,%0                                              \n"
@@ -263,9 +275,11 @@
         mov     eax,80000000h       ; Query for extended functions
         push    ebx
         cpuid                       ; Get extended function limit
+        pop     ebx
         cmp     eax,80000001h
         jl      done                ; Nope, we dont have function 800000001h
         mov     eax,80000001h       ; Setup extended function 800000001h
+        push    ebx
         cpuid                       ; and get the information
         pop     ebx
         mov     features,edx
@@ -276,9 +290,11 @@
 "        movl    $0x80000000,%eax \n"
 "        pushl   %ebx             \n"
 "        cpuid                    \n"
+"        popl    %ebx             \n"
 "        cmpl    $0x80000001,%eax \n"
 "        jl      1f               \n"
 "        movl    $0x80000001,%eax \n"
+"        pushl   %ebx             \n"
 "        cpuid                    \n"
 "        popl    %ebx             \n"
 #ifdef __i386