Changeset 38a6e6b for core/c/jcpuid/src
- Timestamp:
- May 20, 2011 4:26:40 PM (10 years ago)
- Branches:
- master
- Children:
- b5dc9b6f
- Parents:
- 627519e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
core/c/jcpuid/src/jcpuid.c
r627519e r38a6e6b 4 4 5 5 From: http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well 6 See also: http://homesource.nekomimicon.net/sourceforum/viewtopic.php?f=15&t=303 6 7 7 8 Perhaps the most accessible documentation on what PIC code is and how an ELF dynamic linker works is … … 62 63 asm volatile 63 64 ( 65 #if (!defined(__X86_64__)) && (!defined(__x86_64__)) 66 /* 32 bit */ 64 67 "pushl %%ebx \n\t" /* save %ebx */ 68 #endif 65 69 "cpuid \n\t" 70 #if (!defined(__X86_64__)) && (!defined(__x86_64__)) 71 /* 32 bit */ 66 72 "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ 67 73 "popl %%ebx \n\t" /* restore the old %ebx */ 68 74 : "=a" (a), "=r" (b), "=c" (c), "=d" (d) 75 #else 76 /* 64 bit */ 77 : "=a" (a), "=b" (b), "=c" (c), "=d" (d) 78 #endif 69 79 :"a"(iFunction) 70 80 : "cc"
Note: See TracChangeset
for help on using the changeset viewer.