PERFORCE change 228890 for review

Philip Withnall prw35 at FreeBSD.org
Tue May 21 00:32:08 UTC 2013


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

Change 228890 by prw35 at pwithnall_zenith on 2013/05/21 00:31:12

	Fix merge/build failures in CHERI compositor driver
	
	The kernel now builds again. This hasn't been tested on real
	hardware yet, but should work. The changes are pretty trivial.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/sys/dev/cheri/compositor/cheri_compositor_cfb.c#2 edit
.. //depot/projects/ctsrd/cheribsd/src/sys/dev/cheri/compositor/cheri_compositor_reg.c#2 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/sys/dev/cheri/compositor/cheri_compositor_cfb.c#2 (text+ko) ====

@@ -44,6 +44,7 @@
 #include <sys/pcpu.h>
 #include <sys/proc.h>
 #include <sys/rman.h>
+#include <sys/rwlock.h>
 #include <sys/systm.h>
 #include <sys/uio.h>
 #include <vm/pmap.h>
@@ -149,7 +150,7 @@
 
 	pidx = OFF_TO_IDX(offset);
 
-	VM_OBJECT_UNLOCK(vm_obj);
+	VM_OBJECT_WUNLOCK(vm_obj);
 
 	cfb_vm_obj = vm_obj->handle;
 	dev = cfb_vm_obj->dev;
@@ -164,7 +165,7 @@
 
 	if (csw == NULL) {
 		retval = VM_PAGER_FAIL;
-		goto done;
+		goto done_unlocked;
 	}
 
 	/* Traditional d_mmap() call. */
@@ -197,7 +198,7 @@
 	 * free up the all of the original pages.
 	 */
 	page = vm_page_getfake(paddr, memattr);
-	VM_OBJECT_LOCK(vm_obj);
+	VM_OBJECT_WLOCK(vm_obj);
 	vm_page_lock(*mres);
 	vm_page_free(*mres);
 	vm_page_unlock(*mres);
@@ -211,7 +212,7 @@
 	goto done;
 
 done_unlocked:
-	VM_OBJECT_LOCK(vm_obj);
+	VM_OBJECT_WLOCK(vm_obj);
 done:
 	CHERI_COMPOSITOR_DEBUG(sc, "Finished with mres: %p (retval: %i)", *mres,
 	    retval);

==== //depot/projects/ctsrd/cheribsd/src/sys/dev/cheri/compositor/cheri_compositor_reg.c#2 (text+ko) ====

@@ -48,6 +48,7 @@
 #include <sys/priv.h>
 #include <sys/proc.h>
 #include <sys/rman.h>
+#include <sys/rwlock.h>
 #include <sys/systm.h>
 #include <sys/uio.h>
 #include <vm/pmap.h>
@@ -91,7 +92,7 @@
 
 /* Permissions mask giving the maximum set of permissions a CFB ID or token can
  * have. */
-#define CFB_PERMS_MASK (CHERI_Permit_Store | CHERI_Permit_Load)
+#define CFB_PERMS_MASK (CHERI_PERM_STORE | CHERI_PERM_LOAD)
 
 /* Register offsets (in bytes). */
 #define CHERI_COMPOSITOR_COMMAND_HEADER		0
@@ -1304,8 +1305,8 @@
 	/* Check the permissions. */
 	CHERI_CGETPERM(perms, 1);
 
-	if ((perms & CHERI_Permit_Load) == 0 ||
-	    (perms & CHERI_Permit_Store) == 0) {
+	if ((perms & CHERI_PERM_LOAD) == 0 ||
+	    (perms & CHERI_PERM_STORE) == 0) {
 		goto done;
 	}
 
@@ -1348,7 +1349,7 @@
 	CHERI_CINCBASE(1, CHERI_CR_KDC, 0);
 	CHERI_CSETLEN(1, 1, 0);
 	CHERI_CSETTYPE(1, CHERI_CR_KCC, get_kernel_seal_capability);
-	CHERI_CANDPERM(1, 1, CHERI_Permit_Seal);
+	CHERI_CANDPERM(1, 1, CHERI_PERM_SEAL);
 
 	cheri_capability_store(1, cap_out);
 	CHERI_CCLEARTAG(1);


More information about the p4-projects mailing list