From eb6b2a723ee06573c7c9a10e446729cf881073e4 Mon Sep 17 00:00:00 2001 From: Tim Hartley Date: Thu, 28 Nov 2019 16:49:35 +0000 Subject: [PATCH] [feat] Add membarrier system call Also, change the signature of maxine_cache_flush to Address. Doing so avoids upcasting to Pointer when we have an Address and we don't need the enhanced functionality of Pointer over Address at this point anyway. --- com.sun.max/src/com/sun/max/vm/MaxineVM.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/com.sun.max/src/com/sun/max/vm/MaxineVM.java b/com.sun.max/src/com/sun/max/vm/MaxineVM.java index 93500fe47d..f8380f40f4 100644 --- a/com.sun.max/src/com/sun/max/vm/MaxineVM.java +++ b/com.sun.max/src/com/sun/max/vm/MaxineVM.java @@ -592,7 +592,13 @@ public static void registerCriticalMethod(CriticalMethod criticalEntryPoint) { * @param length the number of instructions * sizeof one instruction */ @C_FUNCTION - public static native void maxine_cache_flush(Pointer start, int length); + public static native void maxine_cache_flush(Address start, int length); + + /** + * Executes a membarrier(2) system call on Linux systems. + */ + @C_FUNCTION + public static native void syscall_membarrier(); @C_FUNCTION public static native long arithmeticldiv(long x, long y);