From: Prakash Ramrakhyani Date: Tue, 1 Mar 2016 01:13:15 +0000 (-0600) Subject: util: update Java JNI interface to m5ops X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fed0ea55c476d9843e3f07e4f879254d34d99279;p=gem5.git util: update Java JNI interface to m5ops Synchronize with ab19693da "pseudo inst,util: Add optional key to initparam pseudo instruction" --- diff --git a/util/m5/jni/gem5Op.java b/util/m5/jni/gem5Op.java index bb324b37c..9a58a84f2 100644 --- a/util/m5/jni/gem5Op.java +++ b/util/m5/jni/gem5Op.java @@ -53,7 +53,8 @@ public class gem5Op { public native void wakeCPU(long cpuid); public native void exit(long ns_delay); - public native long initparam(); + public native void fail(long ns_delay, long code); + public native long initparam(long key_str1, long key_str2); public native void checkpoint(long ns_delay, long ns_period); public native void reset_stats(long ns_delay, long ns_period); public native void dump_stats(long ns_delay, long ns_period); diff --git a/util/m5/jni_gem5Op.c b/util/m5/jni_gem5Op.c index 501933e62..c7e73bcbc 100644 --- a/util/m5/jni_gem5Op.c +++ b/util/m5/jni_gem5Op.c @@ -101,10 +101,17 @@ Java_jni_gem5Op_exit(JNIEnv *env, jobject obj, jlong j_ns_delay) m5_exit(j_ns_delay); } +JNIEXPORT void JNICALL +Java_jni_gem5Op_fail(JNIEnv *env, jobject obj, jlong j_ns_delay, jlong j_code) +{ + m5_fail(j_ns_delay, j_code); +} + JNIEXPORT jlong JNICALL -Java_jni_gem5Op_initparam(JNIEnv *env, jobject obj) +Java_jni_gem5Op_initparam(JNIEnv *env, jobject obj, jlong j_key_str1, + jlong j_key_str2) { - uint64_t param = m5_initparam(); + uint64_t param = m5_initparam(j_key_str1, j_key_str2); if (param & 0x8000000000000000ULL) printf("Truncated return value from m_initparam() to 63 bits\n"); return (param & 0x7FFFFFFFFFFFFFFFULL);