PERFORCE change 570899 for review

Robert Watson rwatson at FreeBSD.org
Tue Sep 3 21:09:29 UTC 2013


http://p4web.freebsd.org/@@570899?ac=10

Change 570899 by rwatson at rwatson_zenith_cl_cam_ac_uk on 2013/09/03 21:08:49

	Define CHERI_CCALL() and CHERI_CRETURN() macros in cheri.h for the
	CHERI CCall and CReturn instructions, allowing them to be used from
	C programs compiled using conventional GCC MIPS.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cheri.h#19 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/cheri.h#19 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011-2012 Robert N. M. Watson
+ * Copyright (c) 2011-2013 Robert N. M. Watson
  * All rights reserved.
  *
  * This software was developed by SRI International and the University of
@@ -165,6 +165,19 @@
 } while (0)
 
 /*
+ * Routines associated with CHERI object-capability invocation; currently we
+ * believe these require no clobbers, as they don't directly replace c0.
+ */
+#define	CHERI_CCALL(cs, cb) do {					\
+	__asm__ __volatile__ ("ccall $c%0, %c%1" : :			\
+	    "i" (cs), "i" (cb));					\
+} while (0)
+
+#define	CHERI_CRETURN() do {						\
+	__asm__ __volatile__ ("creturn");				\
+} while (0)
+
+/*
  * Capability store; while this doesn't muck with c0, it does require a memory
  * clobber.
  */


More information about the p4-projects mailing list