Changeset 89e5e1d


Ignore:
Timestamp:
Dec 16, 2015 3:55:39 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
31efa7c
Parents:
1e3e02d
Message:

Fix class for nativeJcpuidVersion()
Add output for nativeJcpuidVersion()
Change CPUIDCPUInfo back to package private
More @since fixes

Location:
core
Files:
4 edited

Legend:

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

    r1e3e02d r89e5e1d  
    1818
    1919/* since version 3 */
    20 JNIEXPORT jint JNICALL Java_net_i2p_util_NativeBigInteger_nativeJcpuidVersion
     20JNIEXPORT jint JNICALL Java_freenet_support_CPUInformation_CPUID_nativeJcpuidVersion
    2121        (JNIEnv* env, jclass cls) {
    2222    return (jint) JCPUID_VERSION;
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    r1e3e02d r89e5e1d  
    3535    /** did we load the native lib correctly? */
    3636    private static boolean _nativeOk = false;
     37    private static int _jcpuidVersion;
    3738
    3839    /**
     
    106107    private static native CPUIDResult doCPUID(int iFunction);
    107108
     109    /**
     110     *  Get the jbigi version, only available since jbigi version 3
     111     *  Caller must catch Throwable
     112     *  @since 0.9.25
     113     */
     114    private native static int nativeJcpuidVersion();
     115
     116    /**
     117     *  Get the jcpuid version
     118     *  @return 0 if no jcpuid available, 2 if version not supported
     119     *  @since 0.9.25
     120     */
     121    private static int fetchJcpuidVersion() {
     122        if (!_nativeOk)
     123            return 0;
     124        try {
     125            return nativeJcpuidVersion();
     126        } catch (Throwable t) {
     127            return 2;
     128        }
     129    }
    108130
    109131    static String getCPUVendorID()
     
    294316            System.out.println("**Failed to retrieve CPUInfo. Please verify the existence of jcpuid dll/so**");
    295317        }
     318        System.out.println("JCPUID Version: " + _jcpuidVersion);
    296319        System.out.println(" **CPUInfo**");
    297320        String mname = getCPUModelName();
     
    397420                }
    398421            }
     422            _jcpuidVersion = fetchJcpuidVersion();
    399423        } else {
    400424            if (_doLog)
  • core/java/src/freenet/support/CPUInformation/CPUIDCPUInfo.java

    r1e3e02d r89e5e1d  
    66 *  @since 0.8.7
    77 */
    8 public class CPUIDCPUInfo implements CPUInfo
     8class CPUIDCPUInfo implements CPUInfo
    99{
    1010    public String getVendor()
  • core/java/src/net/i2p/util/NativeBigInteger.java

    r1e3e02d r89e5e1d  
    503503     * @return big endian twos complement representation of (base ^ exponent) % modulus
    504504     * @throws ArithmeticException if modulus &lt;= 0
    505      * @since 0.9.18 and libjbigi version 3
     505     * @since 0.9.25 and libjbigi version 3
    506506     */
    507507    private native static byte[] nativeModPowCT(byte base[], byte exponent[], byte modulus[]);
    508508
    509509    /**
    510      *  @since 0.9.18 and libjbigi version 3
     510     *  @since 0.9.25 and libjbigi version 3
    511511     *  @throws ArithmeticException
    512512     */
     
    515515    /**
    516516     *  Only for testing jbigi's negative conversion functions!
    517      *  @since 0.9.18
     517     *  @since 0.9.25
    518518     */
    519519    //private native static byte[] nativeNeg(byte d[]);
     
    522522     *  Get the jbigi version, only available since jbigi version 3
    523523     *  Caller must catch Throwable
    524      *  @since 0.9.18
     524     *  @since 0.9.25
    525525     */
    526526    private native static int nativeJbigiVersion();
     
    528528    /**
    529529     *  Get the libmp version, only available since jbigi version 3
    530      *  @since 0.9.18
     530     *  @since 0.9.25
    531531     */
    532532    private native static int nativeGMPMajorVersion();
     
    534534    /**
    535535     *  Get the libmp version, only available since jbigi version 3
    536      *  @since 0.9.18
     536     *  @since 0.9.25
    537537     */
    538538    private native static int nativeGMPMinorVersion();
     
    540540    /**
    541541     *  Get the libmp version, only available since jbigi version 3
    542      *  @since 0.9.18
     542     *  @since 0.9.25
    543543     */
    544544    private native static int nativeGMPPatchVersion();
     
    547547     *  Get the jbigi version
    548548     *  @return 0 if no jbigi available, 2 if version not supported
    549      *  @since 0.9.18
     549     *  @since 0.9.25
    550550     */
    551551    private static int fetchJbigiVersion() {
     
    584584     *  Get the jbigi version
    585585     *  @return 0 if no jbigi available, 2 if version info not supported
    586      *  @since 0.9.18
     586     *  @since 0.9.25
    587587     */
    588588    public static int getJbigiVersion() {
     
    593593     *  Get the libgmp version
    594594     *  @return "unknown" if no jbigi available or if version not supported
    595      *  @since 0.9.18
     595     *  @since 0.9.25
    596596     */
    597597    public static String getLibGMPVersion() {
     
    650650    /**
    651651     *  @throws ArithmeticException if m &lt;= 0
    652      *  @since 0.9.18 and libjbigi version 3 and GMP version 5
     652     *  @since 0.9.25 and libjbigi version 3 and GMP version 5
    653653     */
    654654    public BigInteger modPowCT(BigInteger exponent, BigInteger m) {
     
    661661    /**
    662662     *  @throws ArithmeticException if not coprime with m, or m &lt;= 0
    663      *  @since 0.9.18 and libjbigi version 3
     663     *  @since 0.9.25 and libjbigi version 3
    664664     */
    665665    @Override
Note: See TracChangeset for help on using the changeset viewer.