forked from I2P_Developers/i2p.i2p
restore old cpuid assembly for x64
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
|
|
||||||
From: http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
|
From: http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
|
||||||
|
See also: http://homesource.nekomimicon.net/sourceforum/viewtopic.php?f=15&t=303
|
||||||
|
|
||||||
Perhaps the most accessible documentation on what PIC code is and how an ELF dynamic linker works is
|
Perhaps the most accessible documentation on what PIC code is and how an ELF dynamic linker works is
|
||||||
John Levine's Linkers and Loaders (and it has amazing sketches, too!). The Gentoo documentation also
|
John Levine's Linkers and Loaders (and it has amazing sketches, too!). The Gentoo documentation also
|
||||||
@@ -61,11 +62,20 @@ JNIEXPORT jobject JNICALL Java_freenet_support_CPUInformation_CPUID_doCPUID
|
|||||||
//Use GCC assembler notation
|
//Use GCC assembler notation
|
||||||
asm volatile
|
asm volatile
|
||||||
(
|
(
|
||||||
|
#if (!defined(__X86_64__)) && (!defined(__x86_64__))
|
||||||
|
/* 32 bit */
|
||||||
"pushl %%ebx \n\t" /* save %ebx */
|
"pushl %%ebx \n\t" /* save %ebx */
|
||||||
|
#endif
|
||||||
"cpuid \n\t"
|
"cpuid \n\t"
|
||||||
|
#if (!defined(__X86_64__)) && (!defined(__x86_64__))
|
||||||
|
/* 32 bit */
|
||||||
"movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
|
"movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
|
||||||
"popl %%ebx \n\t" /* restore the old %ebx */
|
"popl %%ebx \n\t" /* restore the old %ebx */
|
||||||
: "=a" (a), "=r" (b), "=c" (c), "=d" (d)
|
: "=a" (a), "=r" (b), "=c" (c), "=d" (d)
|
||||||
|
#else
|
||||||
|
/* 64 bit */
|
||||||
|
: "=a" (a), "=b" (b), "=c" (c), "=d" (d)
|
||||||
|
#endif
|
||||||
:"a"(iFunction)
|
:"a"(iFunction)
|
||||||
: "cc"
|
: "cc"
|
||||||
);
|
);
|
||||||
|
@@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 1;
|
public final static long BUILD = 2;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user