Module Name: src Committed By: matt Date: Tue Jun 30 02:39:04 UTC 2015
Modified Files: src/sys/arch/algor/algor: machdep.c src/sys/arch/arc/arc: machdep.c src/sys/arch/evbmips/ingenic: machdep.c src/sys/arch/evbmips/rmixl: machdep.c src/sys/arch/hpcmips/hpcmips: machdep.c src/sys/arch/newsmips/newsmips: machdep.c src/sys/arch/playstation2/playstation2: machdep.c src/sys/arch/pmax/pmax: machdep.c Log Message: Use cpu_startup_common() To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/arch/algor/algor/machdep.c cvs rdiff -u -r1.128 -r1.129 src/sys/arch/arc/arc/machdep.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbmips/ingenic/machdep.c cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbmips/rmixl/machdep.c cvs rdiff -u -r1.119 -r1.120 src/sys/arch/hpcmips/hpcmips/machdep.c cvs rdiff -u -r1.116 -r1.117 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.30 -r1.31 src/sys/arch/playstation2/playstation2/machdep.c cvs rdiff -u -r1.248 -r1.249 src/sys/arch/pmax/pmax/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/algor/algor/machdep.c diff -u src/sys/arch/algor/algor/machdep.c:1.53 src/sys/arch/algor/algor/machdep.c:1.54 --- src/sys/arch/algor/algor/machdep.c:1.53 Mon Mar 24 20:06:31 2014 +++ src/sys/arch/algor/algor/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.53 2014/03/24 20:06:31 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.54 2015/06/30 02:39:03 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.53 2014/03/24 20:06:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.54 2015/06/30 02:39:03 matt Exp $"); #include "opt_algor_p4032.h" #include "opt_algor_p5064.h" @@ -511,66 +511,24 @@ consinit(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; -#ifdef DEBUG - extern int pmapdebug; - int opmapdebug = pmapdebug; - - pmapdebug = 0; /* Shut up pmap debug during bootstrap */ -#endif - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - printf("%s\n", cpu_getmodel()); - format_bytes(pbuf, sizeof(pbuf), ptoa(physmem)); - printf("total memory = %s\n", pbuf); - /* * Virtual memory is bootstrapped -- notify the bus spaces * that memory allocation is now safe. */ #if defined(ALGOR_P4032) - { - struct p4032_config *acp = &p4032_configuration; + struct p4032_config * const acp = &p4032_configuration; - acp->ac_mallocsafe = 1; - } + acp->ac_mallocsafe = 1; #elif defined(ALGOR_P5064) - { - struct p5064_config *acp = &p5064_configuration; + struct p5064_config * const acp = &p5064_configuration; - acp->ac_mallocsafe = 1; - } + acp->ac_mallocsafe = 1; #elif defined(ALGOR_P6032) - { - struct p6032_config *acp = &p6032_configuration; - - acp->ac_mallocsafe = 1; - } -#endif - - minaddr = 0; - - /* - * Allocate a submap for physio. - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocate via the pool allocator, and we use KSEG0 to - * map those pages. - */ + struct p6032_config * const acp = &p6032_configuration; -#ifdef DEBUG - pmapdebug = opmapdebug; + acp->ac_mallocsafe = 1; #endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } int waittime = -1; Index: src/sys/arch/arc/arc/machdep.c diff -u src/sys/arch/arc/arc/machdep.c:1.128 src/sys/arch/arc/arc/machdep.c:1.129 --- src/sys/arch/arc/arc/machdep.c:1.128 Mon Mar 24 20:06:31 2014 +++ src/sys/arch/arc/arc/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.128 2014/03/24 20:06:31 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.129 2015/06/30 02:39:03 matt Exp $ */ /* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */ /* @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.128 2014/03/24 20:06:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.129 2015/06/30 02:39:03 matt Exp $"); #include "opt_ddb.h" #include "opt_ddbparam.h" @@ -489,48 +489,12 @@ consinit(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; -#ifdef DEBUG - extern int pmapdebug; - int opmapdebug = pmapdebug; - - pmapdebug = 0; /* Shut up pmap debug during bootstrap */ - -#endif - #ifdef BOOTINFO_DEBUG if (bootinfo_msg) printf(bootinfo_msg); #endif - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - printf("%s\n", cpu_getmodel()); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - minaddr = 0; - - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages. - */ - -#ifdef DEBUG - pmapdebug = opmapdebug; -#endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); arc_bus_space_malloc_set_safe(); } Index: src/sys/arch/evbmips/ingenic/machdep.c diff -u src/sys/arch/evbmips/ingenic/machdep.c:1.7 src/sys/arch/evbmips/ingenic/machdep.c:1.8 --- src/sys/arch/evbmips/ingenic/machdep.c:1.7 Thu Jun 11 15:38:18 2015 +++ src/sys/arch/evbmips/ingenic/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.7 2015/06/11 15:38:18 macallan Exp $ */ +/* $NetBSD: machdep.c,v 1.8 2015/06/30 02:39:03 matt Exp $ */ /*- * Copyright (c) 2014 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2015/06/11 15:38:18 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2015/06/30 02:39:03 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -248,41 +248,7 @@ consinit(void) void cpu_startup(void) { - char pbuf[9]; - vaddr_t minaddr, maxaddr; -#ifdef DEBUG - extern int pmapdebug; /* XXX */ - int opmapdebug = pmapdebug; - - pmapdebug = 0; /* Shut up pmap debug during bootstrap */ -#endif - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - printf("%s\n", cpu_getmodel()); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - minaddr = 0; - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, FALSE, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages. - */ - -#ifdef DEBUG - pmapdebug = opmapdebug; -#endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } void Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.16 src/sys/arch/evbmips/rmixl/machdep.c:1.17 --- src/sys/arch/evbmips/rmixl/machdep.c:1.16 Wed Jun 10 22:32:32 2015 +++ src/sys/arch/evbmips/rmixl/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.16 2015/06/10 22:32:32 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.17 2015/06/30 02:39:03 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -74,7 +74,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2015/06/10 22:32:32 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2015/06/30 02:39:03 matt Exp $"); #define __INTR_PRIVATE @@ -978,37 +978,14 @@ consinit(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - format_bytes(pbuf, sizeof(pbuf), ctob((uint64_t)physmem)); - printf("total memory = %s\n", pbuf); - /* * Virtual memory is bootstrapped -- notify the bus spaces * that memory allocation is now safe. */ rmixl_configuration.rc_mallocsafe = 1; - minaddr = 0; - /* - * Allocate a submap for physio. - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, FALSE, NULL); - - /* - * (No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use XKSEG to - * map those pages.) - */ - - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + /* Do the usual stuff */ + cpu_startup_common(); } int waittime = -1; Index: src/sys/arch/hpcmips/hpcmips/machdep.c diff -u src/sys/arch/hpcmips/hpcmips/machdep.c:1.119 src/sys/arch/hpcmips/hpcmips/machdep.c:1.120 --- src/sys/arch/hpcmips/hpcmips/machdep.c:1.119 Wed Mar 26 17:53:36 2014 +++ src/sys/arch/hpcmips/hpcmips/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.119 2014/03/26 17:53:36 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.120 2015/06/30 02:39:03 matt Exp $ */ /*- * Copyright (c) 1999 Shin Takemura, All rights reserved. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.119 2014/03/26 17:53:36 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.120 2015/06/30 02:39:03 matt Exp $"); #include "opt_vr41xx.h" #include "opt_tx39xx.h" @@ -478,55 +478,19 @@ cpuname_printf(const char *fmt, ...) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; - size_t i; -#ifdef DEBUG - extern int pmapdebug; - int opmapdebug = pmapdebug; - - pmapdebug = 0; -#endif - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); cpu_setmodel("%s (%s)", platid_name(&platid), hpcmips_cpuname); - printf("%s\n", cpu_getmodel()); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - if (bootverbose) { - /* show again when verbose mode */ - printf("total memory banks = %d\n", mem_cluster_cnt); - for (i = 0; i < mem_cluster_cnt; i++) { - printf("memory bank %zu = " - "0x%08"PRIxPADDR" %"PRIdPSIZE"KB(0x%08"PRIxPSIZE")\n", i, - (paddr_t)mem_clusters[i].start, - (psize_t)mem_clusters[i].size/1024, - (psize_t)mem_clusters[i].size); - } - } - minaddr = 0; - - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages. - */ + /* show again when verbose mode */ + aprint_verbose("total memory banks = %d\n", mem_cluster_cnt); + for (size_t i = 0; i < mem_cluster_cnt; i++) { + aprint_verbose("memory bank %zu = " + "%#08"PRIxPADDR" %"PRIdPSIZE"KB(%#"PRIxPSIZE")\n", i, + (paddr_t)mem_clusters[i].start, + (psize_t)mem_clusters[i].size/1024, + (psize_t)mem_clusters[i].size); + } -#ifdef DEBUG - pmapdebug = opmapdebug; -#endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } void Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.116 src/sys/arch/newsmips/newsmips/machdep.c:1.117 --- src/sys/arch/newsmips/newsmips/machdep.c:1.116 Mon Nov 24 04:06:13 2014 +++ src/sys/arch/newsmips/newsmips/machdep.c Tue Jun 30 02:39:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.117 2015/06/30 02:39:03 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2015/06/30 02:39:03 matt Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -370,42 +370,10 @@ mips_machdep_cache_config(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; -#ifdef DEBUG - extern int pmapdebug; - int opmapdebug = pmapdebug; - - pmapdebug = 0; -#endif - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); printf("SONY NET WORK STATION, Model %s, ", idrom.id_model); printf("Machine ID #%d\n", idrom.id_serial); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - minaddr = 0; - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages. - */ - -#ifdef DEBUG - pmapdebug = opmapdebug; -#endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } /* Index: src/sys/arch/playstation2/playstation2/machdep.c diff -u src/sys/arch/playstation2/playstation2/machdep.c:1.30 src/sys/arch/playstation2/playstation2/machdep.c:1.31 --- src/sys/arch/playstation2/playstation2/machdep.c:1.30 Mon Mar 31 11:25:49 2014 +++ src/sys/arch/playstation2/playstation2/machdep.c Tue Jun 30 02:39:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.30 2014/03/31 11:25:49 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.31 2015/06/30 02:39:04 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.30 2014/03/31 11:25:49 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.31 2015/06/30 02:39:04 matt Exp $"); #include "opt_ddb.h" #include "opt_kloader.h" @@ -171,32 +171,7 @@ mach_init(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - printf("%s\n", cpu_model); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - minaddr = 0; - /* - * Allocate a submap for physio. - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - - /* - * (No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages.) - */ - - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } void Index: src/sys/arch/pmax/pmax/machdep.c diff -u src/sys/arch/pmax/pmax/machdep.c:1.248 src/sys/arch/pmax/pmax/machdep.c:1.249 --- src/sys/arch/pmax/pmax/machdep.c:1.248 Mon Mar 24 19:31:40 2014 +++ src/sys/arch/pmax/pmax/machdep.c Tue Jun 30 02:39:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.248 2014/03/24 19:31:40 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.249 2015/06/30 02:39:04 matt Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.248 2014/03/24 19:31:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.249 2015/06/30 02:39:04 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -374,42 +374,7 @@ consinit(void) void cpu_startup(void) { - vaddr_t minaddr, maxaddr; - char pbuf[9]; -#ifdef DEBUG - extern int pmapdebug; /* XXX */ - int opmapdebug = pmapdebug; - - pmapdebug = 0; -#endif - - /* - * Good {morning,afternoon,evening,night}. - */ - printf("%s%s", copyright, version); - printf("%s\n", cpu_getmodel()); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - minaddr = 0; - - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use KSEG to - * map those pages. - */ - -#ifdef DEBUG - pmapdebug = opmapdebug; -#endif - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); + cpu_startup_common(); } /*