Loading...
--- xnu/xnu-12377.121.6/bsd/dev/memdev.c
+++ xnu/xnu-8796.121.2/bsd/dev/memdev.c
@@ -92,7 +92,7 @@
 #include <libkern/libkern.h>
 
 #include <vm/pmap.h>
-#include <vm/vm_pager_xnu.h>
+#include <vm/vm_pager.h>
 #include <mach/memory_object_types.h>
 #include <kern/debug.h>
 
@@ -231,6 +231,11 @@
 	mdata = ((addr64_t)mdev[devid].mdBase << 12) + uio->uio_offset; /* Point to the area in "file" */
 
 	saveflag = uio->uio_segflg;                                                     /* Remember what the request is */
+#if LP64_DEBUG
+	if (UIO_IS_USER_SPACE(uio) == 0 && UIO_IS_SYS_SPACE(uio) == 0) {
+		panic("mdevrw - invalid uio_segflg");
+	}
+#endif /* LP64_DEBUG */
 	/* Make sure we are moving from physical ram if physical device */
 	if (mdev[devid].mdFlags & mdPhys) {
 		if (uio->uio_segflg == UIO_USERSPACE64) {