From owner-p4-projects@FreeBSD.ORG Tue Sep 3 21:09:29 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 86EB0ACB; Tue, 3 Sep 2013 21:09:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 46F90AC9 for ; Tue, 3 Sep 2013 21:09:29 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3183529F6 for ; Tue, 3 Sep 2013 21:09:29 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r83L9Tem029261 for ; Tue, 3 Sep 2013 21:09:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r83L9Txc029258 for perforce@freebsd.org; Tue, 3 Sep 2013 21:09:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 3 Sep 2013 21:09:29 GMT Message-Id: <201309032109.r83L9Txc029258@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 570899 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2013 21:09:29 -0000 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. */