Changeset 38a6e6b for core/c/jcpuid


Ignore:
Timestamp:
May 20, 2011 4:26:40 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b5dc9b6f
Parents:
627519e
Message:

restore old cpuid assembly for x64

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/c/jcpuid/src/jcpuid.c

    r627519e r38a6e6b  
    44
    55From: http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
     6See also: http://homesource.nekomimicon.net/sourceforum/viewtopic.php?f=15&t=303
    67
    78Perhaps the most accessible documentation on what PIC code is and how an ELF dynamic linker works is
     
    6263                asm volatile
    6364                (
     65#if (!defined(__X86_64__)) && (!defined(__x86_64__))
     66                        /* 32 bit */
    6467                        "pushl %%ebx      \n\t" /* save %ebx */
     68#endif
    6569                        "cpuid            \n\t"
     70#if (!defined(__X86_64__)) && (!defined(__x86_64__))
     71                        /* 32 bit */
    6672                        "movl %%ebx, %1   \n\t" /* save what cpuid just put in %ebx */
    6773                        "popl %%ebx       \n\t" /* restore the old %ebx */
    6874                        : "=a" (a), "=r" (b), "=c" (c), "=d" (d)
     75#else
     76                        /* 64 bit */
     77                        : "=a" (a), "=b" (b), "=c" (c), "=d" (d)
     78#endif
    6979                        :"a"(iFunction)
    7080                        : "cc"
Note: See TracChangeset for help on using the changeset viewer.