summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-07-06 15:47:41 +0000
committerkettenis <kettenis@openbsd.org>2020-07-06 15:47:41 +0000
commitf589ab0ebc8c32d047e8696da3ae882bd3b21295 (patch)
treef8a6b00ba5a8afabf0bed39fdc3198acdc164a5b /sys
parentAdd a few ${.CURDIR} to make the new RCS tests work with obj/ and obj@. (diff)
downloadwireguard-openbsd-f589ab0ebc8c32d047e8696da3ae882bd3b21295.tar.xz
wireguard-openbsd-f589ab0ebc8c32d047e8696da3ae882bd3b21295.zip
Hide most of the contents behind #ifdef _KERNEL. Reorganize the file a
bit to achieve this with a single #ifdef/#endif pair.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/powerpc64/include/pmap.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/sys/arch/powerpc64/include/pmap.h b/sys/arch/powerpc64/include/pmap.h
index a45e6517cb9..6c06a7100e6 100644
--- a/sys/arch/powerpc64/include/pmap.h
+++ b/sys/arch/powerpc64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.10 2020/07/02 21:51:05 kettenis Exp $ */
+/* $OpenBSD: pmap.h,v 1.11 2020/07/06 15:47:41 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -19,6 +19,8 @@
#ifndef _MACHINE_PMAP_H_
#define _MACHINE_PMAP_H_
+#ifdef _KERNEL
+
#include <machine/pte.h>
/* V->P mapping data */
@@ -54,16 +56,6 @@ typedef struct pmap *pmap_t;
#define PMAP_PA_MASK ~((paddr_t)PAGE_MASK) /* to remove the flags */
#define PMAP_NOCACHE 0x1 /* map uncached */
-struct vm_page_md {
- struct mutex pv_mtx;
- LIST_HEAD(,pte_desc) pv_list;
-};
-
-#define VM_MDPAGE_INIT(pg) do { \
- mtx_init(&(pg)->mdpage.pv_mtx, IPL_VM); \
- LIST_INIT(&((pg)->mdpage.pv_list)); \
-} while (0)
-
extern struct pmap kernel_pmap_store;
#define pmap_kernel() (&kernel_pmap_store)
@@ -86,4 +78,19 @@ struct pte;
struct pte *pmap_get_kernel_pte(vaddr_t);
#endif
+#endif /* _KERNEL */
+
+#include <sys/mutex.h>
+#include <sys/queue.h>
+
+struct vm_page_md {
+ struct mutex pv_mtx;
+ LIST_HEAD(,pte_desc) pv_list;
+};
+
+#define VM_MDPAGE_INIT(pg) do { \
+ mtx_init(&(pg)->mdpage.pv_mtx, IPL_VM); \
+ LIST_INIT(&((pg)->mdpage.pv_list)); \
+} while (0)
+
#endif /* _MACHINE_PMAP_H_ */