Convert the last offender, the SA1110 port, to ARM32_NEW_VM_LAYOUT, and
completely nuke the !ARM32_NEW_VM_LAYOUT case.
This commit is contained in:
parent
410a42a1b6
commit
d661dc8070
@ -412,7 +412,6 @@ static vm_offset_t pmap_kernel_l2dtable_kva;
|
||||
static vm_offset_t pmap_kernel_l2ptp_kva;
|
||||
static vm_paddr_t pmap_kernel_l2ptp_phys;
|
||||
static struct vm_object pvzone_obj;
|
||||
static struct vm_object l2zone_obj;
|
||||
static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
|
||||
int pmap_pagedaemon_waken = 0;
|
||||
|
||||
@ -456,14 +455,8 @@ kernel_pt_lookup(vm_paddr_t pa)
|
||||
struct pv_addr *pv;
|
||||
|
||||
SLIST_FOREACH(pv, &kernel_pt_list, pv_list) {
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
if (pv->pv_pa == (pa & ~PAGE_MASK)) {
|
||||
return (pv->pv_va | (pa & PAGE_MASK));
|
||||
}
|
||||
#else
|
||||
if (pv->pv_pa == pa)
|
||||
return (pv->pv_va);
|
||||
#endif
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
@ -715,21 +708,12 @@ xscale_setup_minidata(vm_offset_t l1pt, vm_offset_t va, vm_paddr_t pa)
|
||||
|
||||
for (; size != 0;
|
||||
va += L2_S_SIZE, pa += L2_S_SIZE, size -= L2_S_SIZE) {
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte = (pt_entry_t *)
|
||||
kernel_pt_lookup(pde[va >> L1_S_SHIFT] & L2_S_FRAME);
|
||||
#else
|
||||
pte = (pt_entry_t *) kernel_pt_lookup(
|
||||
pde[L1_IDX(va)] & L1_C_ADDR_MASK);
|
||||
#endif
|
||||
if (pte == NULL)
|
||||
panic("xscale_setup_minidata: can't find L2 table for "
|
||||
"VA 0x%08x", (u_int32_t) va);
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte[(va >> PAGE_SHIFT) & 0x3ff] =
|
||||
#else
|
||||
pte[l2pte_index(va)] =
|
||||
#endif
|
||||
L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, VM_PROT_READ) |
|
||||
L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X);
|
||||
}
|
||||
@ -1985,7 +1969,6 @@ pmap_init(void)
|
||||
UMA_ZONE_VM | UMA_ZONE_NOFREE);
|
||||
|
||||
uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
|
||||
uma_zone_set_obj(l2zone, &l2zone_obj, pv_entry_max);
|
||||
|
||||
}
|
||||
|
||||
@ -4618,22 +4601,10 @@ pmap_link_l2pt(vm_offset_t l1pt, vm_offset_t va, struct pv_addr *l2pv)
|
||||
pd_entry_t *pde = (pd_entry_t *) l1pt, proto;
|
||||
u_int slot = va >> L1_S_SHIFT;
|
||||
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
KASSERT((va & ((L1_S_SIZE * 4) - 1)) == 0, ("blah"));
|
||||
KASSERT((l2pv->pv_pa & PAGE_MASK) == 0, ("ouin"));
|
||||
#endif
|
||||
|
||||
proto = L1_S_DOM(PMAP_DOMAIN_KERNEL) | L1_C_PROTO;
|
||||
|
||||
pde[slot + 0] = proto | (l2pv->pv_pa + 0x000);
|
||||
#ifdef ARM32_NEW_VM_LAYOUT
|
||||
PTE_SYNC(&pde[slot]);
|
||||
#else
|
||||
pde[slot + 1] = proto | (l2pv->pv_pa + 0x400);
|
||||
pde[slot + 2] = proto | (l2pv->pv_pa + 0x800);
|
||||
pde[slot + 3] = proto | (l2pv->pv_pa + 0xc00);
|
||||
PTE_SYNC_RANGE(&pde[slot + 0], 4);
|
||||
#endif
|
||||
|
||||
SLIST_INSERT_HEAD(&kernel_pt_list, l2pv, pv_list);
|
||||
|
||||
@ -4673,25 +4644,14 @@ pmap_map_entry(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa, int prot,
|
||||
if ((pde[va >> L1_S_SHIFT] & L1_TYPE_MASK) != L1_TYPE_C)
|
||||
panic("pmap_map_entry: no L2 table for VA 0x%08x", va);
|
||||
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte = (pt_entry_t *)
|
||||
kernel_pt_lookup(pde[va >> L1_S_SHIFT] & L2_S_FRAME);
|
||||
#else
|
||||
pte = (pt_entry_t *) kernel_pt_lookup(pde[L1_IDX(va)] & L1_C_ADDR_MASK);
|
||||
#endif
|
||||
|
||||
if (pte == NULL)
|
||||
panic("pmap_map_entry: can't find L2 table for VA 0x%08x", va);
|
||||
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte[(va >> PAGE_SHIFT) & 0x3ff] =
|
||||
L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, prot) | fl;
|
||||
PTE_SYNC(&pte[(va >> PAGE_SHIFT) & 0x3ff]);
|
||||
#else
|
||||
pte[l2pte_index(va)] =
|
||||
L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, prot) | fl;
|
||||
PTE_SYNC(&pte[l2pte_index(va)]);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4767,13 +4727,8 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa,
|
||||
if ((pde[va >> L1_S_SHIFT] & L1_TYPE_MASK) != L1_TYPE_C)
|
||||
panic("pmap_map_chunk: no L2 table for VA 0x%08x", va);
|
||||
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte = (pt_entry_t *)
|
||||
kernel_pt_lookup(pde[va >> L1_S_SHIFT] & L2_S_FRAME);
|
||||
#else
|
||||
pte = (pt_entry_t *) kernel_pt_lookup(
|
||||
pde[L1_IDX(va)] & L1_C_ADDR_MASK);
|
||||
#endif
|
||||
if (pte == NULL)
|
||||
panic("pmap_map_chunk: can't find L2 table for VA"
|
||||
"0x%08x", va);
|
||||
@ -4783,17 +4738,10 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa,
|
||||
printf("L");
|
||||
#endif
|
||||
for (i = 0; i < 16; i++) {
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte[((va >> PAGE_SHIFT) & 0x3f0) + i] =
|
||||
L2_L_PROTO | pa |
|
||||
L2_L_PROT(PTE_KERNEL, prot) | f2l;
|
||||
PTE_SYNC(&pte[((va >> PAGE_SHIFT) & 0x3f0) + i]);
|
||||
#else
|
||||
pte[l2pte_index(va) + i] =
|
||||
L2_L_PROTO | pa |
|
||||
L2_L_PROT(PTE_KERNEL, prot) | f2l;
|
||||
PTE_SYNC(&pte[l2pte_index(va) + i]);
|
||||
#endif
|
||||
}
|
||||
va += L2_L_SIZE;
|
||||
pa += L2_L_SIZE;
|
||||
@ -4805,15 +4753,9 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offset_t va, vm_offset_t pa,
|
||||
#ifdef VERBOSE_INIT_ARM
|
||||
printf("P");
|
||||
#endif
|
||||
#ifndef ARM32_NEW_VM_LAYOUT
|
||||
pte[(va >> PAGE_SHIFT) & 0x3ff] =
|
||||
L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, prot) | f2s;
|
||||
PTE_SYNC(&pte[(va >> PAGE_SHIFT) & 0x3ff]);
|
||||
#else
|
||||
pte[l2pte_index(va)] =
|
||||
L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, prot) | f2s;
|
||||
PTE_SYNC(&pte[l2pte_index(va)]);
|
||||
#endif
|
||||
va += PAGE_SIZE;
|
||||
pa += PAGE_SIZE;
|
||||
resid -= PAGE_SIZE;
|
||||
|
@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define KERNEL_PT_KERNEL 1 /* Page table for mapping kernel */
|
||||
#define KERNEL_PT_L1 4 /* Page table for mapping l1pt */
|
||||
#define KERNEL_PT_VMDATA 5 /* Page tables for mapping kernel VM */
|
||||
#define KERNEL_PT_VMDATA_NUM 4 /* start with 16MB of KVM */
|
||||
#define KERNEL_PT_VMDATA_NUM 7 /* start with 16MB of KVM */
|
||||
#define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
|
||||
|
||||
/* Define various stack sizes in pages */
|
||||
@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$");
|
||||
#else
|
||||
#define UND_STACK_SIZE 1
|
||||
#endif
|
||||
#define KERNEL_VM_BASE (KERNBASE + 0x00c00000)
|
||||
#define KERNEL_VM_BASE (KERNBASE + 0x00100000)
|
||||
#define KERNEL_VM_SIZE 0x05000000
|
||||
|
||||
extern u_int data_abort_handler_address;
|
||||
@ -287,9 +287,18 @@ initarm(void *arg, void *arg2)
|
||||
valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
|
||||
valloc_pages(md_bla, L2_TABLE_SIZE / PAGE_SIZE);
|
||||
alloc_pages(sa1_cache_clean_addr, CPU_SA110_CACHE_CLEAN_SIZE / PAGE_SIZE);
|
||||
|
||||
for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) {
|
||||
valloc_pages(kernel_pt_table[loop],
|
||||
L2_TABLE_SIZE / PAGE_SIZE);
|
||||
if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) {
|
||||
valloc_pages(kernel_pt_table[loop],
|
||||
L2_TABLE_SIZE / PAGE_SIZE);
|
||||
} else {
|
||||
kernel_pt_table[loop].pv_pa = freemempos +
|
||||
(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) *
|
||||
L2_TABLE_SIZE_REAL;
|
||||
kernel_pt_table[loop].pv_va =
|
||||
kernel_pt_table[loop].pv_pa;
|
||||
}
|
||||
}
|
||||
|
||||
valloc_pages(systempage, 1);
|
||||
@ -336,10 +345,10 @@ initarm(void *arg, void *arg2)
|
||||
pmap_link_l2pt(l1pagetable, MDROOT_ADDR,
|
||||
&md_bla);
|
||||
for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; ++loop)
|
||||
pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000,
|
||||
pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00100000,
|
||||
&kernel_pt_table[KERNEL_PT_VMDATA + loop]);
|
||||
pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE,
|
||||
(uint32_t)&end - KERNBASE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
|
||||
((uint32_t)&end - KERNBASE), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
|
||||
/* Map the stack pages */
|
||||
pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
|
||||
IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
|
||||
|
@ -46,7 +46,6 @@ arm/arm/vm_machdep.c standard
|
||||
arm/fpe-arm/armfpe_glue.S optional armfpe
|
||||
arm/fpe-arm/armfpe_init.c optional armfpe
|
||||
arm/fpe-arm/armfpe.S optional armfpe
|
||||
dev/hwpmc/hwpmc_arm.c optional hwpmc
|
||||
geom/geom_bsd.c standard
|
||||
geom/geom_bsd_enc.c standard
|
||||
geom/geom_mbr.c standard
|
||||
|
@ -1,5 +1,4 @@
|
||||
#$FreeBSD$
|
||||
ARM32_NEW_VM_LAYOUT opt_vm.h
|
||||
ARM9_CACHE_WRITE_THROUGH opt_global.h
|
||||
ARM_CACHE_LOCK_ENABLE opt_global.h
|
||||
ARMFPE opt_global.h
|
||||
|
Loading…
Reference in New Issue
Block a user