Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2013 21:09:29 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 570899 for review
Message-ID:  <201309032109.r83L9Txc029258@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@570899?ac=10

Change 570899 by rwatson@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.
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309032109.r83L9Txc029258>