Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern rumpkern: Abusing struct pmap inte...



details:   https://anonhg.NetBSD.org/src/rev/85baf8d51fe3
branches:  trunk
changeset: 369548:85baf8d51fe3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Aug 21 10:18:20 2022 +0000

description:
rumpkern: Abusing struct pmap internals now requires extra effort.

(as it should)

diffstat:

 sys/rump/librump/rumpkern/vm.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r b1c7e90854f5 -r 85baf8d51fe3 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Sun Aug 21 10:18:11 2022 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Sun Aug 21 10:18:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.192 2021/09/16 21:29:42 andvar Exp $  */
+/*     $NetBSD: vm.c,v 1.193 2022/08/21 10:18:20 riastradh Exp $       */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.192 2021/09/16 21:29:42 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.193 2022/08/21 10:18:20 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -56,6 +56,19 @@
 
 #include <machine/pmap.h>
 
+#if defined(__i386__) || defined(__x86_64__)
+/*
+ * This file abuses the pmap abstraction to create its own statically
+ * allocated struct pmap object, even though it can't do anything
+ * useful with such a thing from userland.  On x86 the struct pmap
+ * definition is private, so we have to go to extra effort to abuse it
+ * there.  This should be fixed -- all of the struct pmap definitions
+ * should be private, and then rump can furnish its own fake struct
+ * pmap without clashing with anything.
+ */
+#include <machine/pmap_private.h>
+#endif
+
 #include <uvm/uvm.h>
 #include <uvm/uvm_ddb.h>
 #include <uvm/uvm_pdpolicy.h>



Home | Main Index | Thread Index | Old Index