Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch map_pagetable() -> pmap_link_l2pt(), and move it to...
details: https://anonhg.NetBSD.org/src/rev/6afe32b085b4
branches: trunk
changeset: 522523:6afe32b085b4
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Feb 20 20:41:15 2002 +0000
description:
map_pagetable() -> pmap_link_l2pt(), and move it to pmap.c
diffstat:
sys/arch/acorn32/acorn32/rpc_machdep.c | 15 +++++++--------
sys/arch/arm/arm32/arm32_machdep.c | 23 +----------------------
sys/arch/arm/arm32/pmap.c | 24 ++++++++++++++++++++++--
sys/arch/arm/include/arm32/machdep.h | 3 +--
sys/arch/arm/include/arm32/pmap.h | 3 ++-
sys/arch/cats/cats/cats_machdep.c | 12 ++++++------
sys/arch/evbarm/integrator/integrator_machdep.c | 11 +++++------
sys/arch/evbarm/iq80310/iq80310_machdep.c | 12 ++++++------
sys/arch/hpcarm/hpcarm/hpc_machdep.c | 13 ++++++-------
sys/arch/netwinder/netwinder/netwinder_machdep.c | 11 +++++------
sys/arch/shark/ofw/ofw.c | 15 +++++++--------
11 files changed, 68 insertions(+), 74 deletions(-)
diffs (truncated from 378 to 300 lines):
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/acorn32/acorn32/rpc_machdep.c
--- a/sys/arch/acorn32/acorn32/rpc_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/acorn32/acorn32/rpc_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rpc_machdep.c,v 1.18 2002/02/20 02:32:56 thorpej Exp $ */
+/* $NetBSD: rpc_machdep.c,v 1.19 2002/02/20 20:41:15 thorpej Exp $ */
/*
* Copyright (c) 2000-2001 Reinoud Zandijk.
@@ -57,7 +57,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: rpc_machdep.c,v 1.18 2002/02/20 02:32:56 thorpej Exp $");
+__RCSID("$NetBSD: rpc_machdep.c,v 1.19 2002/02/20 20:41:15 thorpej Exp $");
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -186,7 +186,6 @@
void physcon_display_base __P((u_int addr));
extern void consinit __P((void));
-void map_pagetable __P((vm_offset_t pt, vm_offset_t va, vm_offset_t pa));
vm_size_t map_chunk __P((vm_offset_t pd, vm_offset_t pt, vm_offset_t va,
vm_offset_t pa, vm_size_t size, u_int acc,
u_int flg));
@@ -687,16 +686,16 @@
l1pagetable = kernel_l1pt.pv_pa;
/* Map the L2 pages tables in the L1 page table */
- map_pagetable(l1pagetable, 0x00000000,
+ pmap_link_l2pt(l1pagetable, 0x00000000,
kernel_pt_table[KERNEL_PT_SYS]);
- map_pagetable(l1pagetable, KERNEL_BASE,
+ pmap_link_l2pt(l1pagetable, KERNEL_BASE,
kernel_pt_table[KERNEL_PT_KERNEL]);
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- map_pagetable(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
kernel_pt_table[KERNEL_PT_VMDATA + loop]);
- map_pagetable(l1pagetable, PROCESS_PAGE_TBLS_BASE,
+ pmap_link_l2pt(l1pagetable, PROCESS_PAGE_TBLS_BASE,
kernel_ptpt.pv_pa);
- map_pagetable(l1pagetable, VMEM_VBASE,
+ pmap_link_l2pt(l1pagetable, VMEM_VBASE,
kernel_pt_table[KERNEL_PT_VMEM]);
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm32_machdep.c,v 1.14 2002/02/20 02:32:57 thorpej Exp $ */
+/* $NetBSD: arm32_machdep.c,v 1.15 2002/02/20 20:41:15 thorpej Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -155,27 +155,6 @@
* during the bootstrap process.
*/
-void
-map_pagetable(pagetable, va, pa)
- vaddr_t pagetable;
- vaddr_t va;
- paddr_t pa;
-{
-#ifdef DIAGNOSTIC
- if ((pa & 0xc00) != 0)
- panic("pagetables should be group allocated on pageboundry");
-#endif /* DIAGNOSTIC */
-
- ((u_int *)pagetable)[(va >> PDSHIFT) + 0] =
- L1_PTE((pa & PG_FRAME) + 0x000);
- ((u_int *)pagetable)[(va >> PDSHIFT) + 1] =
- L1_PTE((pa & PG_FRAME) + 0x400);
- ((u_int *)pagetable)[(va >> PDSHIFT) + 2] =
- L1_PTE((pa & PG_FRAME) + 0x800);
- ((u_int *)pagetable)[(va >> PDSHIFT) + 3] =
- L1_PTE((pa & PG_FRAME) + 0xc00);
-}
-
/* cats kernels have a 2nd l2 pt, so the range is bigger hence the 0x7ff etc */
vsize_t
map_chunk(pd, pt, va, pa, size, acc, flg)
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/arm/arm32/pmap.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.41 2002/02/20 02:32:57 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.42 2002/02/20 20:41:16 thorpej Exp $ */
/*
* Copyright (c) 2001 Richard Earnshaw
@@ -142,7 +142,7 @@
#include <machine/param.h>
#include <arm/arm32/katelib.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41 2002/02/20 02:32:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.42 2002/02/20 20:41:16 thorpej Exp $");
#ifdef PMAP_DEBUG
#define PDEBUG(_lev_,_stat_) \
if (pmap_debug_level >= (_lev_)) \
@@ -3760,3 +3760,23 @@
pte[(va >> PGSHIFT) & 0x3ff] = L2_SPTE(pa & PG_FRAME, ap, fl);
#endif
}
+
+/*
+ * pmap_link_l2pt:
+ *
+ * Link the L2 page table specified by "pa" into the L1
+ * page table at the slot for "va".
+ */
+void
+pmap_link_l2pt(vaddr_t l1pt, vaddr_t va, paddr_t l2pa)
+{
+ pd_entry_t *pde = (pd_entry_t *) l1pt;
+ u_int slot = va >> PDSHIFT;
+
+ KASSERT((l2pa & PGOFSET) == 0);
+
+ pde[slot + 0] = L1_PTE(l2pa + 0x000);
+ pde[slot + 1] = L1_PTE(l2pa + 0x400);
+ pde[slot + 2] = L1_PTE(l2pa + 0x800);
+ pde[slot + 3] = L1_PTE(l2pa + 0xc00);
+}
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/arm/include/arm32/machdep.h
--- a/sys/arch/arm/include/arm32/machdep.h Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/arm/include/arm32/machdep.h Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.5 2002/02/20 02:32:57 thorpej Exp $ */
+/* $NetBSD: machdep.h,v 1.6 2002/02/20 20:41:16 thorpej Exp $ */
#ifndef _ARM32_BOOT_MACHDEP_H_
#define _ARM32_BOOT_MACHDEP_H_
@@ -11,7 +11,6 @@
void undefinedinstruction_bounce __P((trapframe_t *));
void dumpsys __P((void));
-void map_pagetable(vaddr_t, vaddr_t, paddr_t);
vsize_t map_chunk(vaddr_t, vaddr_t, vaddr_t, paddr_t, vsize_t,
u_int, u_int);
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/arm/include/arm32/pmap.h
--- a/sys/arch/arm/include/arm32/pmap.h Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/arm/include/arm32/pmap.h Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.25 2002/02/20 02:32:58 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.26 2002/02/20 20:41:16 thorpej Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe.
@@ -188,6 +188,7 @@
/* Bootstrapping routines. */
void pmap_map_section(vaddr_t, vaddr_t, paddr_t, int, int);
void pmap_map_entry(vaddr_t, vaddr_t, paddr_t, int, int);
+void pmap_link_l2pt(vaddr_t, vaddr_t, paddr_t);
/*
* Special page zero routine for use by the idle loop (no cache cleans).
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/cats/cats/cats_machdep.c
--- a/sys/arch/cats/cats/cats_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/cats/cats/cats_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cats_machdep.c,v 1.17 2002/02/20 02:32:58 thorpej Exp $ */
+/* $NetBSD: cats_machdep.c,v 1.18 2002/02/20 20:41:16 thorpej Exp $ */
/*
* Copyright (c) 1997,1998 Mark Brinicombe.
@@ -551,17 +551,17 @@
l1pagetable = kernel_l1pt.pv_pa;
/* Map the L2 pages tables in the L1 page table */
- map_pagetable(l1pagetable, 0x00000000,
+ pmap_link_l2pt(l1pagetable, 0x00000000,
kernel_pt_table[KERNEL_PT_SYS]);
- map_pagetable(l1pagetable, KERNEL_BASE,
+ pmap_link_l2pt(l1pagetable, KERNEL_BASE,
kernel_pt_table[KERNEL_PT_KERNEL]);
- map_pagetable(l1pagetable, KERNEL_BASE + 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_BASE + 0x00400000,
kernel_pt_table[KERNEL_PT_KERNEL2]);
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- map_pagetable(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
kernel_pt_table[KERNEL_PT_VMDATA + loop]);
- map_pagetable(l1pagetable, PROCESS_PAGE_TBLS_BASE,
+ pmap_link_l2pt(l1pagetable, PROCESS_PAGE_TBLS_BASE,
kernel_ptpt.pv_pa);
#ifdef VERBOSE_INIT_ARM
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/evbarm/integrator/integrator_machdep.c
--- a/sys/arch/evbarm/integrator/integrator_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/evbarm/integrator/integrator_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: integrator_machdep.c,v 1.10 2002/02/20 02:32:58 thorpej Exp $ */
+/* $NetBSD: integrator_machdep.c,v 1.11 2002/02/20 20:41:17 thorpej Exp $ */
/*
* Copyright (c) 2001 ARM Ltd
@@ -165,7 +165,6 @@
void consinit __P((void));
-void map_pagetable __P((vm_offset_t pt, vm_offset_t va, vm_offset_t pa));
vm_size_t map_chunk __P((vm_offset_t pd, vm_offset_t pt, vm_offset_t va,
vm_offset_t pa, vm_size_t size, u_int acc,
u_int flg));
@@ -617,14 +616,14 @@
l1pagetable = kernel_l1pt.pv_pa;
/* Map the L2 pages tables in the L1 page table */
- map_pagetable(l1pagetable, 0x00000000,
+ pmap_link_l2pt(l1pagetable, 0x00000000,
kernel_pt_table[KERNEL_PT_SYS]);
- map_pagetable(l1pagetable, KERNEL_BASE,
+ pmap_link_l2pt(l1pagetable, KERNEL_BASE,
kernel_pt_table[KERNEL_PT_KERNEL]);
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- map_pagetable(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
kernel_pt_table[KERNEL_PT_VMDATA + loop]);
- map_pagetable(l1pagetable, PROCESS_PAGE_TBLS_BASE,
+ pmap_link_l2pt(l1pagetable, PROCESS_PAGE_TBLS_BASE,
kernel_ptpt.pv_pa);
#ifdef VERBOSE_INIT_ARM
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/evbarm/iq80310/iq80310_machdep.c
--- a/sys/arch/evbarm/iq80310/iq80310_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/evbarm/iq80310/iq80310_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iq80310_machdep.c,v 1.22 2002/02/20 02:32:58 thorpej Exp $ */
+/* $NetBSD: iq80310_machdep.c,v 1.23 2002/02/20 20:41:17 thorpej Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -589,16 +589,16 @@
l1pagetable = kernel_l1pt.pv_pa;
/* Map the L2 pages tables in the L1 page table */
- map_pagetable(l1pagetable, 0x00000000,
+ pmap_link_l2pt(l1pagetable, 0x00000000,
kernel_pt_table[KERNEL_PT_SYS]);
- map_pagetable(l1pagetable, KERNEL_BASE,
+ pmap_link_l2pt(l1pagetable, KERNEL_BASE,
kernel_pt_table[KERNEL_PT_KERNEL]);
- map_pagetable(l1pagetable, IQ80310_IOPXS_VBASE,
+ pmap_link_l2pt(l1pagetable, IQ80310_IOPXS_VBASE,
kernel_pt_table[KERNEL_PT_IOPXS]);
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- map_pagetable(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
kernel_pt_table[KERNEL_PT_VMDATA + loop]);
- map_pagetable(l1pagetable, PROCESS_PAGE_TBLS_BASE,
+ pmap_link_l2pt(l1pagetable, PROCESS_PAGE_TBLS_BASE,
kernel_ptpt.pv_pa);
#ifdef VERBOSE_INIT_ARM
diff -r 6a1597bac0e8 -r 6afe32b085b4 sys/arch/hpcarm/hpcarm/hpc_machdep.c
--- a/sys/arch/hpcarm/hpcarm/hpc_machdep.c Wed Feb 20 20:40:48 2002 +0000
+++ b/sys/arch/hpcarm/hpcarm/hpc_machdep.c Wed Feb 20 20:41:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hpc_machdep.c,v 1.29 2002/02/20 02:32:58 thorpej Exp $ */
+/* $NetBSD: hpc_machdep.c,v 1.30 2002/02/20 20:41:17 thorpej Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@@ -177,7 +177,6 @@
void physcon_display_base __P((u_int addr));
void consinit __P((void));
-void map_pagetable __P((vaddr_t pt, vaddr_t va, vaddr_t pa));
vm_size_t map_chunk __P((vaddr_t pd, vaddr_t pt, vaddr_t va,
vaddr_t pa, vm_size_t size, u_int acc,
u_int flg));
@@ -501,17 +500,17 @@
l1pagetable = kernel_l1pt.pv_pa;
/* Map the L2 pages tables in the L1 page table */
- map_pagetable(l1pagetable, 0x00000000,
+ pmap_link_l2pt(l1pagetable, 0x00000000,
kernel_pt_table[KERNEL_PT_SYS]);
- map_pagetable(l1pagetable, KERNEL_SPACE_START,
+ pmap_link_l2pt(l1pagetable, KERNEL_SPACE_START,
kernel_pt_table[KERNEL_PT_KERNEL]);
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
- map_pagetable(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
+ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
kernel_pt_table[KERNEL_PT_VMDATA + loop]);
- map_pagetable(l1pagetable, PROCESS_PAGE_TBLS_BASE,
+ pmap_link_l2pt(l1pagetable, PROCESS_PAGE_TBLS_BASE,
kernel_ptpt.pv_pa);
#define SAIPIO_BASE 0xd0000000 /* XXX XXX */
- map_pagetable(l1pagetable, SAIPIO_BASE,
+ pmap_link_l2pt(l1pagetable, SAIPIO_BASE,
kernel_pt_table[KERNEL_PT_IO]);
Home |
Main Index |
Thread Index |
Old Index