Commit bc37704d authored by Ivo Anjo's avatar Ivo Anjo

Rename TestRtmSupport class to CheckRtmSupport to avoid confusion with the Tests

The buildfile excludes files with Test in the name when packing the jar, but we need the
TestRtmSupport class, so to avoid further confusion it is now named CheckRtmSupport.
parent 667d595d
......@@ -77,17 +77,17 @@
<path path="${classes.dir}"/>
</classpath>
<class name="javartm.Transaction"/>
<class name="javartm.TestRtmSupport"/>
<class name="javartm.CheckRtmSupport"/>
</javah>
</target>
<target name="jni-compile-libtestrtmsupport" depends="jni-headers">
<target name="jni-compile-libcheckrtmsupport" depends="jni-headers">
<mkdir dir="${jnioutput.dir}"/>
<cc outtype="shared" subsystem="console" objdir="${jni.dir}" outfile="${jnioutput.dir}/testrtmsupport">
<cc outtype="shared" subsystem="console" objdir="${jni.dir}" outfile="${jnioutput.dir}/checkrtmsupport">
<compilerarg value="-Wall"/>
<compilerarg value="-O2"/>
<compilerarg value="-std=c99"/>
<fileset dir="${c.src.dir}" includes="**/TestRtmSupport.c"/>
<fileset dir="${c.src.dir}" includes="**/CheckRtmSupport.c"/>
<includepath>
<path path="${java.home}/../include"/>
<path path="${jni.dir}"/>
......@@ -129,7 +129,7 @@
<compilerarg value="-march=core-avx2"/>
<fileset dir="${c.src.dir}"
includes="**/*.c"
excludes="**/TestRtmSupport.c **/Transaction-dummy.c"/>
excludes="**/CheckRtmSupport.c **/Transaction-dummy.c"/>
<includepath>
<path path="${java.home}/../include"/>
<path path="${jni.dir}"/>
......@@ -156,7 +156,7 @@
<defineset define="JAVARTM_RTM_INTRINSICS"/>
<fileset dir="${c.src.dir}"
includes="**/*.c"
excludes="**/TestRtmSupport.c **/Transaction-dummy.c"/>
excludes="**/CheckRtmSupport.c **/Transaction-dummy.c"/>
<includepath>
<path path="${java.home}/../include"/>
<path path="${jni.dir}"/>
......@@ -175,7 +175,7 @@
<defineset define="JAVARTM_RTM_INTRINSICS"/>
<fileset dir="${c.src.dir}"
includes="**/*.c"
excludes="**/TestRtmSupport.c **/Transaction-dummy.c"/>
excludes="**/CheckRtmSupport.c **/Transaction-dummy.c"/>
<includepath>
<path path="${java.home}/../include"/>
<path path="${jni.dir}"/>
......@@ -190,7 +190,7 @@
</trycatch>
</target>
<target name="jni-compile" depends="jni-compile-libtestrtmsupport,jni-compile-libjavartm-dummy,jni-compile-libjavartm"/>
<target name="jni-compile" depends="jni-compile-libcheckrtmsupport,jni-compile-libjavartm-dummy,jni-compile-libjavartm"/>
<target name="build" depends="clean,java-compile,jni-compile" description="Builds javartm (java and native resources)"/>
......
......@@ -26,11 +26,11 @@
// Needed for JNI
#include <jni.h>
#include "javartm_TestRtmSupport.h"
#include "javartm_CheckRtmSupport.h"
#define bit_RTM (1 << 11)
JNIEXPORT jboolean JNICALL Java_javartm_TestRtmSupport_rtmAvailable(JNIEnv *env, jclass cls) {
JNIEXPORT jboolean JNICALL Java_javartm_CheckRtmSupport_rtmAvailable(JNIEnv *env, jclass cls) {
unsigned int eax, ebx, ecx, edx;
if (__get_cpuid_max(0, NULL) >= 7) {
__cpuid_count(7, 0, eax, ebx, ecx, edx);
......
......@@ -25,15 +25,15 @@ import java.io.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final class TestRtmSupport {
private static final Logger Log = LoggerFactory.getLogger(TestRtmSupport.class);
final class CheckRtmSupport {
private static final Logger Log = LoggerFactory.getLogger(CheckRtmSupport.class);
static {
// Bind native methods
Transaction.loadNativeLibrary("testrtmsupport");
Transaction.loadNativeLibrary("checkrtmsupport");
}
private TestRtmSupport() { }
private CheckRtmSupport() { }
protected native static boolean rtmAvailable();
}
......@@ -49,7 +49,7 @@ public final class Transaction {
public static final int ABORT_DEBUG = 1 << 4;
public static final int ABORT_NESTED = 1 << 5;
public static final boolean RTM_AVAILABLE = TestRtmSupport.rtmAvailable();
public static final boolean RTM_AVAILABLE = CheckRtmSupport.rtmAvailable();
static {
if (!RTM_AVAILABLE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment