diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-06 15:47:42 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-06 15:47:42 +0000 |
commit | e672fbb78c8633a63758add91c9f8f2001b6bdba (patch) | |
tree | 2599bf25157c55c644512704a7e53a26acc91c68 | |
parent | e391907f8c65fabc8c0bbfdc2b58198166d7d4e0 (diff) |
Hide most of the contents behind #ifdef _KERNEL. Reorganize the file a
bit to achieve this with a single #ifdef/#endif pair.
-rw-r--r-- | sys/arch/powerpc64/include/pmap.h | 29 |
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_ */ |