PERFORCE change 228885 for review

Philip Withnall prw35 at FreeBSD.org
Mon May 20 23:16:45 UTC 2013


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

Change 228885 by prw35 at pwithnall_zenith on 2013/05/20 23:15:58

	Add CHERI_CSEALDATA and CHERI_CUNSEAL macros to cheri.h
	
	This is needed by the compositor driver. They wrap the CSealData and
	CUnseal instructions, respectively.

Affected files ...

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

Differences ...

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

@@ -38,6 +38,7 @@
 #endif
 
 #include <machine/cherireg.h>
+#include <sys/types.h>
 
 /*
  * Canonical C-language representation of a capability.
@@ -151,6 +152,19 @@
 } while (0)
 
 /*
+ * Instructions to seal and unseal capabilities.
+ */
+#define CHERI_CSEALDATA(cd, cs, ct) do {				\
+	__asm__ __volatile__ ("csealdata $c%0, $c%1, $c%2" : :		\
+		    "i" (cd), "i" (cs), "i" (ct));			\
+} while (0)
+
+#define CHERI_CUNSEAL(cd, cs, ct) do {					\
+	__asm__ __volatile__ ("cunseal $c%0, $c%1, $c%2" : :		\
+		    "i" (cd), "i" (cs), "i" (ct));			\
+} 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