diff options
author | ian <ian@FreeBSD.org> | 2014-05-15 19:09:31 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-15 19:09:31 +0000 |
commit | 24fc8c91c2a303dba31262f57dc8f84b411be5dd (patch) | |
tree | 2e4dfb68203c51cfd6406ba8d87578b7f5b99263 /sys/arm/xscale | |
parent | c287c5d5301219fe2fabc25222edae29e314c213 (diff) | |
download | FreeBSD-src-24fc8c91c2a303dba31262f57dc8f84b411be5dd.zip FreeBSD-src-24fc8c91c2a303dba31262f57dc8f84b411be5dd.tar.gz |
MFC r257549, r261642
Don't create a distinct free page pool for segregating allocations that are
accessed through the direct map unless the kernel configuration actually
includes a direct map. Only a few configurations do, and for the rest the
unnecessary free page pool is a small pessimization.
Remove the ARM_USE_SMALL_ALLOC option and code related to it.
Diffstat (limited to 'sys/arm/xscale')
-rw-r--r-- | sys/arm/xscale/i80321/ep80219_machdep.c | 35 | ||||
-rw-r--r-- | sys/arm/xscale/i80321/iq31244_machdep.c | 35 | ||||
-rw-r--r-- | sys/arm/xscale/i8134x/crb_machdep.c | 37 | ||||
-rw-r--r-- | sys/arm/xscale/ixp425/avila_machdep.c | 33 | ||||
-rw-r--r-- | sys/arm/xscale/pxa/pxa_machdep.c | 36 | ||||
-rw-r--r-- | sys/arm/xscale/pxa/std.pxa | 1 |
6 files changed, 1 insertions, 176 deletions
diff --git a/sys/arm/xscale/i80321/ep80219_machdep.c b/sys/arm/xscale/i80321/ep80219_machdep.c index 4857fcd..c5e9141 100644 --- a/sys/arm/xscale/i80321/ep80219_machdep.c +++ b/sys/arm/xscale/i80321/ep80219_machdep.c @@ -231,21 +231,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -285,15 +270,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -359,10 +335,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -375,13 +347,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + IQ80321_SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; diff --git a/sys/arm/xscale/i80321/iq31244_machdep.c b/sys/arm/xscale/i80321/iq31244_machdep.c index e706280..31b9d70 100644 --- a/sys/arm/xscale/i80321/iq31244_machdep.c +++ b/sys/arm/xscale/i80321/iq31244_machdep.c @@ -232,21 +232,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000), - (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -286,15 +271,6 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); @@ -360,10 +336,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; dump_avail[2] = 0; @@ -376,13 +348,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0xa0000000 + memsize - 1); phys_avail[i++] = 0; diff --git a/sys/arm/xscale/i8134x/crb_machdep.c b/sys/arm/xscale/i8134x/crb_machdep.c index 5bc6c10..1cf79b9 100644 --- a/sys/arm/xscale/i8134x/crb_machdep.c +++ b/sys/arm/xscale/i8134x/crb_machdep.c @@ -230,22 +230,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0x00100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0100000, freemem_pt - 0x00100000, 1); - freemem_after -= ((freemem_after - 0x00001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); -#if 0 - arm_add_smallalloc_pages((void *)(freemem_after + 0xc0000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0x00001000, 0); -#endif - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now we start construction of the L1 page table * We start by mapping the L2 page tables into the L1. @@ -274,15 +258,6 @@ initarm(struct arm_boot_params *abp) } -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif - /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -338,10 +313,7 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM_USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ + dump_avail[0] = 0x00000000; dump_avail[1] = 0x00000000 + memsize; dump_avail[2] = 0; @@ -354,13 +326,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0x00001000; - phys_avail[i++] = 0x00002000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + SDRAM_START); phys_avail[i++] = trunc_page(0x00000000 + memsize - 1); phys_avail[i++] = 0; diff --git a/sys/arm/xscale/ixp425/avila_machdep.c b/sys/arm/xscale/ixp425/avila_machdep.c index 8166a4b..3abdf22 100644 --- a/sys/arm/xscale/ixp425/avila_machdep.c +++ b/sys/arm/xscale/ixp425/avila_machdep.c @@ -301,24 +301,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - (PHYSADDR + 0x100000)) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0100000, - freemem_pt - (PHYSADDR + 0x100000), 1); - freemem_after -= ((freemem_after - (PHYSADDR + 0x1000)) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages( - (void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR)), - (void *)0xc0001000, - trunc_page(freemem_after) - (PHYSADDR + 0x1000), 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Now construct the L1 page table. First map the L2 @@ -354,14 +336,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -442,13 +416,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = PHYSADDR; - phys_avail[i++] = PHYSADDR + PAGE_SIZE; /* - *XXX: Gross hack to get our - * pages in the vm_page_array. - */ -#endif phys_avail[i++] = round_page(virtual_avail - KERNBASE + PHYSADDR); phys_avail[i++] = trunc_page(PHYSADDR + memsize - 1); phys_avail[i++] = 0; diff --git a/sys/arm/xscale/pxa/pxa_machdep.c b/sys/arm/xscale/pxa/pxa_machdep.c index 0843088..a9cf13f 100644 --- a/sys/arm/xscale/pxa/pxa_machdep.c +++ b/sys/arm/xscale/pxa/pxa_machdep.c @@ -213,20 +213,6 @@ initarm(struct arm_boot_params *abp) valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); -#ifdef ARM_USE_SMALL_ALLOC - freemempos -= PAGE_SIZE; - freemem_pt = trunc_page(freemem_pt); - freemem_after = freemempos - ((freemem_pt - 0xa0100000) / - PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0100000, freemem_pt - 0xa0100000, 1); - freemem_after -= ((freemem_after - 0xa0001000) / PAGE_SIZE) * - sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0x20000000) - , (void *)0xc0001000, trunc_page(freemem_after) - 0xa0001000, 0); - freemempos = trunc_page(freemem_after); - freemempos -= PAGE_SIZE; -#endif /* * Allocate memory for the l1 and l2 page tables. The scheme to avoid * wasting memory by allocating the l1pt on the first 16k memory was @@ -267,13 +253,6 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); -#ifdef ARM_USE_SMALL_ALLOC - if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { - arm_add_smallalloc_pages((void *)(freemem_after), - (void*)(freemem_after + PAGE_SIZE), - afterkern - (freemem_after + PAGE_SIZE), 0); - } -#endif /* Map the Mini-Data cache clean area. */ xscale_setup_minidata(l1pagetable, afterkern, @@ -350,10 +329,6 @@ initarm(struct arm_boot_params *abp) arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); pmap_curmaxkvaddr = afterkern + PAGE_SIZE; - /* - * ARM USE_SMALL_ALLOC uses dump_avail, so it must be filled before - * calling pmap_bootstrap. - */ i = 0; for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) { if (memsize[j] > 0) { @@ -371,13 +346,6 @@ initarm(struct arm_boot_params *abp) mutex_init(); i = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[i++] = 0xa0000000; - phys_avail[i++] = 0xa0001000; /* - *XXX: Gross hack to get our - * pages in the vm_page_array - . */ -#endif for (j = 0; j < PXA2X0_SDRAM_BANKS; j++) { if (memsize[j] > 0) { phys_avail[i] = round_page(memstart[j]); @@ -393,11 +361,7 @@ initarm(struct arm_boot_params *abp) phys_avail[i++] = 0; dump_avail[i] = 0; phys_avail[i] = 0; -#ifdef ARM_USE_SMALL_ALLOC - phys_avail[2] = round_page(virtual_avail - KERNBASE + phys_avail[2]); -#else phys_avail[0] = round_page(virtual_avail - KERNBASE + phys_avail[0]); -#endif init_param2(physmem); kdb_init(); diff --git a/sys/arm/xscale/pxa/std.pxa b/sys/arm/xscale/pxa/std.pxa index 63ef885..b8e3484 100644 --- a/sys/arm/xscale/pxa/std.pxa +++ b/sys/arm/xscale/pxa/std.pxa @@ -6,5 +6,4 @@ makeoptions KERNPHYSADDR=0xa0200000 makeoptions KERNVIRTADDR=0xc0200000 makeoptions CONF_CFLAGS=-mcpu=xscale options XSCALE_CACHE_READ_WRITE_ALLOCATE -options ARM_USE_SMALL_ALLOC machine arm |