summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2021-09-14 16:18:58 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2021-09-14 16:18:58 +0000
commit027b654ac1255fe2251fe898099bc76ffe34cff4 (patch)
treef881022f8dd12ae2429ab71a2a47f42b7d95c72a
parent9acc30fa3ab89c59aa26d7e7a9bf9e26abbe30ca (diff)
Cleanup some style issues.
ok mlarkin@
-rw-r--r--sys/arch/arm64/arm64/pmap.c75
1 files changed, 26 insertions, 49 deletions
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c
index 79a344cc84e..688ae5d05c4 100644
--- a/sys/arch/arm64/arm64/pmap.c
+++ b/sys/arch/arm64/arm64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.80 2021/09/02 12:09:26 patrick Exp $ */
+/* $OpenBSD: pmap.c,v 1.81 2021/09/14 16:18:57 kettenis Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
@@ -16,19 +16,15 @@
*/
#include <sys/param.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/systm.h>
-#include <sys/pool.h>
#include <sys/atomic.h>
+#include <sys/pool.h>
+#include <sys/proc.h>
#include <uvm/uvm.h>
-#include "arm64/vmparam.h"
-#include "arm64/pmap.h"
-#include "machine/cpufunc.h"
-#include "machine/pcb.h"
+#include <machine/cpufunc.h>
+#include <machine/pmap.h>
#include <machine/db_machdep.h>
#include <ddb/db_extern.h>
@@ -69,20 +65,6 @@ struct pte_desc {
vaddr_t pted_va;
};
-/* VP routines */
-int pmap_vp_enter(pmap_t pm, vaddr_t va, struct pte_desc *pted, int flags);
-struct pte_desc *pmap_vp_remove(pmap_t pm, vaddr_t va);
-void pmap_vp_destroy(pmap_t pm);
-void pmap_vp_destroy_l2_l3(pmap_t pm, struct pmapvp1 *vp1);
-struct pte_desc *pmap_vp_lookup(pmap_t pm, vaddr_t va, uint64_t **);
-
-/* PV routines */
-void pmap_enter_pv(struct pte_desc *pted, struct vm_page *);
-void pmap_remove_pv(struct pte_desc *pted);
-
-void _pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, int flags,
- int cache);
-
struct pmapvp0 {
uint64_t l0[VP_IDX0_CNT];
struct pmapvp1 *vp[VP_IDX0_CNT];
@@ -106,48 +88,43 @@ CTASSERT(sizeof(struct pmapvp0) == sizeof(struct pmapvp1));
CTASSERT(sizeof(struct pmapvp0) == sizeof(struct pmapvp2));
CTASSERT(sizeof(struct pmapvp0) == sizeof(struct pmapvp3));
+void pmap_vp_destroy(pmap_t pm);
+
/* Allocator for VP pool. */
-void *pmap_vp_page_alloc(struct pool *, int, int *);
-void pmap_vp_page_free(struct pool *, void *);
+void *pmap_vp_page_alloc(struct pool *, int, int *);
+void pmap_vp_page_free(struct pool *, void *);
struct pool_allocator pmap_vp_allocator = {
pmap_vp_page_alloc, pmap_vp_page_free, sizeof(struct pmapvp0)
};
-void pmap_remove_pted(pmap_t pm, struct pte_desc *pted);
-void pmap_kremove_pg(vaddr_t va);
-void pmap_set_l1(struct pmap *, uint64_t, struct pmapvp1 *);
-void pmap_set_l2(struct pmap *, uint64_t, struct pmapvp1 *, struct pmapvp2 *);
-void pmap_set_l3(struct pmap *, uint64_t, struct pmapvp2 *, struct pmapvp3 *);
-
-/* XXX */
-void
-pmap_fill_pte(pmap_t pm, vaddr_t va, paddr_t pa, struct pte_desc *pted,
- vm_prot_t prot, int flags, int cache);
-void pmap_pte_insert(struct pte_desc *pted);
-void pmap_pte_remove(struct pte_desc *pted, int);
-void pmap_pte_update(struct pte_desc *pted, uint64_t *pl3);
-void pmap_kenter_cache(vaddr_t va, paddr_t pa, vm_prot_t prot, int cacheable);
-void pmap_pinit(pmap_t pm);
-void pmap_release(pmap_t pm);
-paddr_t pmap_steal_avail(size_t size, int align, void **kva);
-void pmap_remove_avail(paddr_t base, paddr_t end);
-vaddr_t pmap_map_stolen(vaddr_t);
-void pmap_physload_avail(void);
-extern caddr_t msgbufaddr;
+void pmap_remove_pted(pmap_t, struct pte_desc *);
+void pmap_kremove_pg(vaddr_t);
+void pmap_set_l1(struct pmap *, uint64_t, struct pmapvp1 *);
+void pmap_set_l2(struct pmap *, uint64_t, struct pmapvp1 *,
+ struct pmapvp2 *);
+void pmap_set_l3(struct pmap *, uint64_t, struct pmapvp2 *,
+ struct pmapvp3 *);
+
+void pmap_fill_pte(pmap_t, vaddr_t, paddr_t, struct pte_desc *,
+ vm_prot_t, int, int);
+void pmap_pte_insert(struct pte_desc *);
+void pmap_pte_remove(struct pte_desc *, int);
+void pmap_pte_update(struct pte_desc *, uint64_t *);
+void pmap_release(pmap_t);
+paddr_t pmap_steal_avail(size_t, int, void **);
+void pmap_remove_avail(paddr_t, paddr_t);
+vaddr_t pmap_map_stolen(vaddr_t);
vaddr_t vmmap;
vaddr_t zero_page;
vaddr_t copy_src_page;
vaddr_t copy_dst_page;
-/* XXX - panic on pool get failures? */
struct pool pmap_pmap_pool;
struct pool pmap_pted_pool;
struct pool pmap_vp_pool;
-/* list of L1 tables */
-
int pmap_initialized = 0;
struct mem_region {