From 71991877bea22a82789b29c8995baf0589fd2be4 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 11 Aug 2009 18:46:33 +0000 Subject: With the SysV memory allocation changes, allocsys() doesn't do anything anymore. Get rid of it completely. --- sys/arch/alpha/alpha/machdep.c | 40 +------------------------ sys/arch/amd64/amd64/machdep.c | 49 ++++-------------------------- sys/arch/arm/arm/arm32_machdep.c | 37 +---------------------- sys/arch/aviion/aviion/machdep.c | 37 ++--------------------- sys/arch/hp300/hp300/machdep.c | 37 +---------------------- sys/arch/hppa/hppa/machdep.c | 15 ++-------- sys/arch/hppa64/hppa64/machdep.c | 4 +-- sys/arch/i386/i386/machdep.c | 55 ++++------------------------------ sys/arch/luna88k/luna88k/machdep.c | 37 ++--------------------- sys/arch/mac68k/mac68k/machdep.c | 37 +---------------------- sys/arch/macppc/macppc/machdep.c | 28 +---------------- sys/arch/mvme68k/mvme68k/machdep.c | 34 +-------------------- sys/arch/mvme88k/mvme88k/machdep.c | 37 ++--------------------- sys/arch/mvmeppc/mvmeppc/machdep.c | 29 +----------------- sys/arch/sgi/sgi/machdep.c | 27 +---------------- sys/arch/sh/sh/sh_machdep.c | 35 +--------------------- sys/arch/socppc/socppc/machdep.c | 28 +---------------- sys/arch/solbourne/solbourne/machdep.c | 37 +---------------------- sys/arch/sparc/sparc/machdep.c | 37 +---------------------- sys/arch/sparc64/sparc64/machdep.c | 23 +------------- sys/arch/vax/vax/machdep.c | 36 +--------------------- 21 files changed, 34 insertions(+), 665 deletions(-) (limited to 'sys') diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index fb6be61c516..080c1fd9a72 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.118 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.119 2009/08/11 18:46:30 miod Exp $ */ /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */ /*- @@ -117,7 +117,6 @@ int cpu_dump(void); int cpu_dumpsize(void); u_long cpu_dump_mempagecnt(void); void dumpsys(void); -caddr_t allocsys(caddr_t); void identifycpu(void); void regdump(struct trapframe *framep); void printregs(struct reg *); @@ -211,9 +210,7 @@ alpha_init(pfn, ptb, bim, bip, biv) struct vm_physseg *vps; vaddr_t kernstart, kernend; paddr_t kernstartpfn, kernendpfn, pfn0, pfn1; - vsize_t size; char *p; - caddr_t v; const char *bootinfo_msg; const struct cpuinit *c; extern caddr_t esym; @@ -642,22 +639,6 @@ nobootinfo: proc0.p_addr = proc0paddr = (struct user *)pmap_steal_memory(UPAGES * PAGE_SIZE, NULL, NULL); - /* - * Allocate space for system data structures. These data structures - * are allocated here instead of cpu_startup() because physical - * memory is directly addressable. We don't have to map these into - * virtual address space. - */ - size = (vsize_t)allocsys(NULL); - v = (caddr_t)pmap_steal_memory(size, NULL, NULL); - if ((allocsys(v) - v) != size) - panic("alpha_init: table size inconsistency"); - - /* - * Clear allocated memory. - */ - bzero(v, size); - /* * Initialize the virtual memory system, and set the * page table base register in proc 0's PCB. @@ -798,25 +779,6 @@ nobootinfo: } } -caddr_t -allocsys(v) - caddr_t v; -{ - /* - * Allocate space for system data structures. - * The first available kernel virtual address is in "v". - * As pages of kernel virtual memory are allocated, "v" is incremented. - * - * These data structures are allocated here instead of cpu_startup() - * because physical memory is directly addressable. We don't have - * to map these into virtual address space. - */ -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)ALIGN((name)+(num)) - - return v; -} - void consinit() { diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 4c244b1e2a1..e3802e15839 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.99 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.100 2009/08/11 18:46:31 miod Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -251,8 +251,6 @@ u_int32_t bios_cksumlen; phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX]; int mem_cluster_cnt; -vaddr_t allocsys(vaddr_t); -void setup_buffers(void); int cpu_dump(void); int cpu_dumpsize(void); u_long cpu_dump_mempagecnt(void); @@ -298,8 +296,6 @@ int allowaperture = 0; void cpu_startup(void) { - vaddr_t v; - vsize_t sz; vaddr_t minaddr, maxaddr; msgbuf_vaddr = PMAP_DIRECT_MAP(msgbuf_paddr); @@ -311,16 +307,11 @@ cpu_startup(void) ptoa((psize_t)physmem)/1024/1024); /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. + * Determine how many buffers to allocate. + * We allocate bufcachepercent% of memory for buffer space. */ - sz = allocsys(0); - if ((v = uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - - setup_buffers(); + if (bufpages == 0) + bufpages = physmem * bufcachepercent / 100; /* * Allocate a submap for exec arguments. This map effectively @@ -360,36 +351,6 @@ cpu_startup(void) x86_bus_space_mallocok(); } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -vaddr_t -allocsys(vaddr_t v) -{ - -#define valloc(name, type, num) \ - v = (vaddr_t)(((name) = (type *)v) + (num)) - - return v; -} - -void -setup_buffers() -{ - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; -} - /* * Set up proc0's TSS and LDT. */ diff --git a/sys/arch/arm/arm/arm32_machdep.c b/sys/arch/arm/arm/arm32_machdep.c index 74773c5d0df..bf035342094 100644 --- a/sys/arch/arm/arm/arm32_machdep.c +++ b/sys/arch/arm/arm/arm32_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arm32_machdep.c,v 1.30 2009/08/09 21:03:49 blambert Exp $ */ +/* $OpenBSD: arm32_machdep.c,v 1.31 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: arm32_machdep.c,v 1.42 2003/12/30 12:33:15 pk Exp $ */ /* @@ -74,7 +74,6 @@ struct vm_map *exec_map = NULL; struct vm_map *phys_map = NULL; extern int physmem; -caddr_t allocsys(caddr_t); #ifndef BUFCACHEPERCENT #define BUFCACHEPERCENT 5 @@ -245,8 +244,6 @@ cpu_startup() u_int loop; paddr_t minaddr; paddr_t maxaddr; - caddr_t sysbase; - caddr_t size; proc0paddr = (struct user *)kernelstack.pv_va; proc0.p_addr = proc0paddr; @@ -288,19 +285,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - size = allocsys(NULL); - sysbase = (caddr_t)uvm_km_zalloc(kernel_map, round_page((vaddr_t)size)); - if (sysbase == 0) - panic( - "cpu_startup: no room for system tables; %d bytes required", - (u_int)size); - if ((caddr_t)((allocsys(sysbase) - sysbase)) != size) - panic("cpu_startup: system table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -435,22 +419,3 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) } /* NOTREACHED */ } - -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(caddr_t v) -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c index b28cef05d15..b0897a57c4e 100644 --- a/sys/arch/aviion/aviion/machdep.c +++ b/sys/arch/aviion/aviion/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.31 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.32 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 2007 Miodrag Vallat. * @@ -111,7 +111,6 @@ #include #endif /* DDB */ -caddr_t allocsys(caddr_t); void aviion_bootstrap(void); int aviion_identify(void); void consinit(void); @@ -245,8 +244,7 @@ setstatclockrate(int newhz) void cpu_startup() { - caddr_t v; - int sz, i; + int i; vaddr_t minaddr, maxaddr; /* @@ -267,17 +265,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Grab machine dependent memory spaces */ @@ -324,26 +311,6 @@ cpu_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - __dead void doboot() { diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c index 5e1d61baec0..7b633b7f487 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.124 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.125 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */ /* @@ -138,7 +138,6 @@ char extiospace[EXTENT_FIXED_STORAGE_SIZE(8)]; extern int eiomapsize; /* prototypes for local functions */ -caddr_t allocsys(caddr_t); void parityenable(void); int parityerror(struct frame *); int parityerrorfind(void); @@ -235,9 +234,7 @@ cpu_startup() { extern char *etext; unsigned i; - caddr_t v; vaddr_t minaddr, maxaddr; - vsize_t size; #ifdef DEBUG extern int pmapdebug; int opmapdebug = pmapdebug; @@ -270,16 +267,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - size = (vsize_t)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(size))) == 0) - panic("startup: no room for tables"); - if ((allocsys(v) - v) != size) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -349,28 +336,6 @@ cpu_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)((name)+(num)) -#define valloclim(name, type, num, lim) \ - (name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num))) - - return (v); -} - /* * Info for CTL_HW */ diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index eb38acffd6c..a8d372255c8 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.176 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.177 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -286,7 +286,6 @@ hppa_init(start) { extern u_long cpu_hzticks; extern int kernel_text; - vaddr_t v, v1; int error; pdc_init(); /* init PDC iface, so we can call em easy */ @@ -385,18 +384,8 @@ hppa_init(start) EX_NOWAIT)) panic("cannot reserve main memory"); - /* - * Now allocate kernel dynamic variables - */ - - v1 = v = round_page(start); -#define valloc(name, type, num) (name) = (type *)v; v = (vaddr_t)((name)+(num)) -#undef valloc - v = round_page(v); - bzero ((void *)v1, (v - v1)); - /* sets resvphysmem */ - pmap_bootstrap(v); + pmap_bootstrap(round_page(start)); /* space has been reserved in pmap_bootstrap() */ initmsgbuf((caddr_t)(ptoa(physmem) - round_page(MSGBUFSIZE)), diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c index 78e5a34a72c..efab3f596b9 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.17 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.18 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -264,7 +264,7 @@ TODO hpmc/toc/pfr panic("cannot reserve main memory"); /* sets resvphysmem */ - pmap_bootstrap(start); + pmap_bootstrap(round_page(start)); /* space has been reserved in pmap_bootstrap() */ msgbufp = (struct msgbuf *)((vaddr_t)ptoa(physmem) - diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index c708a5250ef..6e0727f4fce 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.458 2009/08/11 17:15:54 oga Exp $ */ +/* $OpenBSD: machdep.c,v 1.459 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -263,8 +263,6 @@ struct extent *ioport_ex; struct extent *iomem_ex; static int ioport_malloc_safe; -caddr_t allocsys(caddr_t); -void setup_buffers(void); void dumpsys(void); int cpu_dump(void); void init386(paddr_t); @@ -370,8 +368,6 @@ void cpu_startup() { unsigned i; - caddr_t v; - int sz; vaddr_t minaddr, maxaddr, va; paddr_t pa; @@ -407,20 +403,11 @@ cpu_startup() (unsigned long long)ptoa((psize_t)physmem)/1024U/1024U); /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - - /* - * Now allocate buffers proper. They are different than the above - * in that they usually occupy more virtual memory than physical. + * Determine how many buffers to allocate. We use bufcachepercent% + * of the memory below 4GB. */ - setup_buffers(); + if (bufpages == 0) + bufpages = atop(avail_end) * bufcachepercent / 100; /* * Allocate a submap for exec arguments. This map effectively @@ -507,38 +494,6 @@ i386_init_pcb_tss_ldt(struct cpu_info *ci) } #endif /* MULTIPROCESSOR */ - -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(caddr_t v) -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - -void -setup_buffers() -{ - /* - * Determine how many buffers to allocate. We use bufcachepercent% - * of the memory below 4GB. - */ - if (bufpages == 0) - bufpages = atop(avail_end) * bufcachepercent / 100; - -} - /* * Info for CTL_HW */ diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index 7c3ea5c6006..2726d4fa5bc 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.66 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.67 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -102,7 +102,6 @@ #include /* db_printf() */ #endif /* DDB */ -caddr_t allocsys(caddr_t); void consinit(void); void cpu_boot_secondary_processors(void); void dumpconf(void); @@ -353,8 +352,7 @@ identifycpu() void cpu_startup() { - caddr_t v; - int sz, i; + int i; vaddr_t minaddr, maxaddr; /* @@ -438,17 +436,6 @@ cpu_startup() } #endif - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Grab the OBIO space that we hardwired in pmap_bootstrap */ @@ -506,26 +493,6 @@ cpu_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - __dead void boot(howto) int howto; diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index c9610b24db3..8097b84fcec 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.151 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.152 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */ /* @@ -209,7 +209,6 @@ int astpending = 0; void identifycpu(void); u_long get_physical(u_int, u_long *); -caddr_t allocsys(caddr_t); void initcpu(void); int cpu_dumpsize(void); int cpu_dump(int (*)(dev_t, daddr64_t, caddr_t, size_t), daddr64_t *); @@ -353,11 +352,9 @@ consinit(void) void cpu_startup(void) { - caddr_t v; unsigned i; int vers; vaddr_t minaddr, maxaddr; - vsize_t size = 0; /* To avoid compiler warning */ int delay; /* @@ -399,16 +396,6 @@ cpu_startup(void) printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addressses. - */ - size = (vsize_t)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(size))) == 0) - panic("startup: no room for tables"); - if ((allocsys(v) - v) != size) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -458,28 +445,6 @@ cpu_startup(void) iomem_malloc_safe = 1; } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)((name)+(num)) -#define valloclim(name, type, num, lim) \ - (name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num))) - - return (v); -} - void initcpu() { diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index a87a0b852d7..40a9a9e172f 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.111 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.112 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -142,7 +142,6 @@ int allowaperture = 0; void ofw_dbg(char *str); -caddr_t allocsys(caddr_t); void dumpsys(void); void systype(char *name); int lcsplx(int ipl); /* called from LCore */ @@ -477,11 +476,8 @@ install_extint(void (*handler)(void)) void cpu_startup() { - int sz; - caddr_t v; vaddr_t minaddr, maxaddr; - v = (caddr_t)proc0paddr + USPACE; proc0.p_addr = proc0paddr; printf("%s", version); @@ -489,16 +485,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -532,18 +518,6 @@ cpu_startup() devio_malloc_safe = 1; } -/* - * Allocate space for system data structures. - */ -caddr_t -allocsys(caddr_t v) -{ -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - /* * consinit * Initialize system console. diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 674c03e0461..1c3282c1afd 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.118 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.119 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -164,7 +164,6 @@ int fpu_gettype(void); int memsize162(void); int memsize1x7(void); /* in locore */ int memsize(void); -caddr_t allocsys(caddr_t); void mvme68k_init() @@ -217,9 +216,7 @@ void cpu_startup() { unsigned i; - caddr_t v; vaddr_t minaddr, maxaddr; - vsize_t size; #ifdef DEBUG extern int pmapdebug; int opmapdebug = pmapdebug; @@ -245,16 +242,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - size = (vsize_t)allocsys((caddr_t)0); - if ((v = (caddr_t) uvm_km_zalloc(kernel_map, round_page(size))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != size) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -300,25 +287,6 @@ cpu_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * You call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(caddr_t v) -{ - -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)((name) + (num)) - - return (v); -} - /* * Info for CTL_HW */ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 8f0618e21e7..13f790cd9ba 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.233 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.234 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -92,7 +92,6 @@ #include #endif /* DDB */ -caddr_t allocsys(caddr_t); void consinit(void); void cpu_hatch_secondary_processors(void *); void dumb_delay(int); @@ -339,8 +338,7 @@ setstatclockrate(int newhz) void cpu_startup() { - caddr_t v; - int sz, i; + int i; vaddr_t minaddr, maxaddr; /* @@ -361,17 +359,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Grab machine dependent memory spaces */ @@ -441,26 +428,6 @@ cpu_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - __dead void _doboot() { diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c index 4310933de8d..c5685002d6a 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.60 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.61 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -135,8 +135,6 @@ int system_type = SYS_TYPE; /* XXX Hardwire it for now */ struct firmware *fw = NULL; extern struct firmware ppc1_firmware; -caddr_t allocsys(caddr_t); - /* * Extent maps to manage I/O. Allocate storage for 8 regions in each, * initially. Later devio_malloc_safe will indicate that it's safe to @@ -384,8 +382,6 @@ install_extint(handler) void cpu_startup() { - int sz; - caddr_t v; vaddr_t minaddr, maxaddr; proc0.p_addr = proc0paddr; @@ -395,16 +391,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -443,19 +429,6 @@ cpu_startup() prep_bus_space_init(); } -/* - * Allocate space for system data structures. - */ -caddr_t -allocsys(v) - caddr_t v; -{ -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - /* * consinit * Initialize system console. diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index 3c6e3333fb2..58bb0da8d5a 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.79 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.80 2009/08/11 18:46:32 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -122,7 +122,6 @@ caddr_t mips_init(int, void *, caddr_t); void initcpu(void); void dumpsys(void); void dumpconf(void); -caddr_t allocsys(caddr_t); static void dobootopts(int, void *); static int atoi(const char *, int, const char **); @@ -142,7 +141,6 @@ mips_init(int argc, void *argv, caddr_t boot_esym) { char *cp; int i; - caddr_t sd; u_int cputype; vaddr_t tlb_handler, xtlb_handler; extern char start[], edata[], end[]; @@ -497,13 +495,6 @@ mips_init(int argc, void *argv, caddr_t boot_esym) proc0.p_md.md_regs = (struct trap_frame *)&proc0paddr->u_pcb.pcb_regs; tlb_set_pid(1); - /* - * Allocate system data structures. - */ - i = (vsize_t)allocsys(NULL); - sd = (caddr_t)pmap_steal_memory(i, NULL, NULL); - allocsys(sd); - /* * Bootstrap VM system. */ @@ -566,22 +557,6 @@ mips_init(int argc, void *argv, caddr_t boot_esym) return ((caddr_t)proc0paddr + USPACE - 64); } -/* - * Allocate space for system data structures. Doesn't need to be mapped. - */ -caddr_t -allocsys(caddr_t v) -{ - caddr_t start; - - start = v; - -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)((name)+(num)) - - return(v); -} - /* * Build a tlb trampoline */ diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index 70c1c052220..b6e19c2b170 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.24 2009/08/09 21:13:12 blambert Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.25 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -148,8 +148,6 @@ extern char sh3_vector_tlbmiss[], sh3_vector_tlbmiss_end[]; extern char sh4_vector_tlbmiss[], sh4_vector_tlbmiss_end[]; #endif -caddr_t allocsys(caddr_t); - /* * These variables are needed by /sbin/savecore */ @@ -256,8 +254,6 @@ void sh_startup() { vaddr_t minaddr, maxaddr; - caddr_t sysbase; - caddr_t size; printf("%s", version); if (*cpu_model != '\0') @@ -282,18 +278,6 @@ sh_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - size = allocsys(NULL); - sysbase = (caddr_t)uvm_km_zalloc(kernel_map, round_page((vaddr_t)size)); - if (sysbase == 0) - panic("sh_startup: no room for system tables; %d required", - (u_int)size); - if ((caddr_t)((allocsys(sysbase) - sysbase)) != size) - panic("cpu_startup: system table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -338,23 +322,6 @@ sh_startup() } } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(caddr_t v) -{ -#define valloc(name, type, num) v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - void dumpconf(void) { diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c index b5efd4e5ba3..f1477e0ad49 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.16 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.17 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -133,7 +133,6 @@ int allowaperture = 0; #endif #endif -caddr_t allocsys(caddr_t); void dumpsys(void); int lcsplx(int ipl); void myetheraddr(u_char *); @@ -740,11 +739,8 @@ bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh, void cpu_startup() { - int sz; - caddr_t v; vaddr_t minaddr, maxaddr; - v = (caddr_t)proc0paddr + USPACE; proc0.p_addr = proc0paddr; printf("%s", version); @@ -752,16 +748,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -795,18 +781,6 @@ cpu_startup() devio_malloc_safe = 1; } -/* - * Allocate space for system data structures. - */ -caddr_t -allocsys(caddr_t v) -{ -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return v; -} - /* * consinit * Initialize system console. diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c index 0587d885e06..48518fdb19d 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.12 2009/08/09 10:40:18 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.13 2009/08/11 18:46:32 miod Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -122,7 +122,6 @@ int safepri = 0; vaddr_t dvma_base, dvma_end; struct extent *dvmamap_extent; -caddr_t allocsys(caddr_t); void dumpsys(void); static int kap_maskcheck(void); @@ -132,8 +131,6 @@ static int kap_maskcheck(void); void cpu_startup() { - caddr_t v; - int sz; #ifdef DEBUG extern int pmapdebug; int opmapdebug = pmapdebug; @@ -168,18 +165,6 @@ cpu_startup() printf("real mem = %d (%dMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - - if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -234,26 +219,6 @@ cpu_startup() intr_init(); } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * You call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return (v); -} - /* * Set up registers on exec. * diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 600593896e1..5e0b5825ecf 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.121 2009/08/09 10:40:18 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.122 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -137,7 +137,6 @@ int safepri = 0; vaddr_t dvma_base, dvma_end; struct extent *dvmamap_extent; -caddr_t allocsys(caddr_t); void dumpsys(void); void stackdump(void); @@ -147,8 +146,6 @@ void stackdump(void); void cpu_startup() { - caddr_t v; - int sz; #ifdef DEBUG extern int pmapdebug; int opmapdebug = pmapdebug; @@ -182,18 +179,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (int)allocsys((caddr_t)0); - - if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -263,26 +248,6 @@ cpu_startup() intr_init(); } -/* - * Allocate space for system data structures. We are given - * a starting virtual address and we return a final virtual - * address; along the way we set each data structure pointer. - * - * You call allocsys() with 0 to find out how much space we want, - * allocate that much and fill it with zeroes, and then call - * allocsys() again with the correct base virtual address. - */ -caddr_t -allocsys(v) - caddr_t v; -{ - -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return (v); -} - /* * Set up registers on exec. * diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index f5bd8c8765c..cad2d0aff64 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.119 2009/08/09 10:40:18 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.120 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -207,7 +207,6 @@ extern int64_t cecclast; int safepri = 0; void blink_led_timeout(void *); -caddr_t allocsys(caddr_t); void dumpsys(void); void stackdump(void); @@ -217,8 +216,6 @@ void stackdump(void); void cpu_startup() { - caddr_t v; - long sz; #ifdef DEBUG extern int pmapdebug; int opmapdebug = pmapdebug; @@ -239,15 +236,6 @@ cpu_startup() /*identifycpu();*/ printf("real mem = %lu (%luMB)\n", ptoa((psize_t)physmem), ptoa((psize_t)physmem)/1024/1024); - /* - * Find out how much space we need, allocate it, - * and then give everything true virtual addresses. - */ - sz = (long)allocsys(NULL); - if ((v = (caddr_t)uvm_km_alloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for %lx bytes of tables", sz); - if (allocsys(v) - v != sz) - panic("startup: table size inconsistency"); /* * Determine how many buffers to allocate. @@ -280,15 +268,6 @@ cpu_startup() #endif } -caddr_t -allocsys(caddr_t v) -{ -#define valloc(name, type, num) \ - v = (caddr_t)(((name) = (type *)v) + (num)) - - return (v); -} - /* * Set up registers on exec. */ diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index b113a39a8ef..5fccc2bec91 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.104 2009/08/09 10:40:18 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.105 2009/08/11 18:46:32 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -114,8 +114,6 @@ #include "led.h" -caddr_t allocsys(caddr_t); - #ifndef BUFCACHEPERCENT #define BUFCACHEPERCENT 5 #endif @@ -167,8 +165,6 @@ void dumpconf(void); void cpu_startup() { - caddr_t v; - int sz; vaddr_t minaddr, maxaddr; extern char cpu_model[]; @@ -190,17 +186,6 @@ cpu_startup() mtpr(AST_NO, PR_ASTLVL); spl0(); - /* - * Find out how much space we need, allocate it, and then give - * everything true virtual addresses. - */ - - sz = (int) allocsys((caddr_t)0); - if ((v = (caddr_t)uvm_km_zalloc(kernel_map, round_page(sz))) == 0) - panic("startup: no room for tables"); - if (((unsigned long)allocsys(v) - (unsigned long)v) != sz) - panic("startup: table size inconsistency"); - /* * Determine how many buffers to allocate. * We allocate bufcachepercent% of memory for buffer space. @@ -891,25 +876,6 @@ vax_unmap_physmem(addr, size) size * VAX_NBPG, EX_NOWAIT); } -/* - * Allocate space for system data structures. We are given a starting - * virtual address and we return a final virtual address; along the way we - * set each data structure pointer. - * - * We call allocsys() with 0 to find out how much space we want, allocate that - * much and fill it with zeroes, and then call allocsys() again with the - * correct base virtual address. - */ -#define VALLOC(name, type, num) v = (caddr_t)(((name) = (type *)v) + (num)) - -caddr_t -allocsys(v) - register caddr_t v; -{ - - return (v); -} - /* * The following is a very stripped-down db_disasm.c, with only the logic * to skip instructions. -- cgit v1.2.3