Move common global variables, i.e., phys_map, machine, and machine_arch to evbppc/evbppc_machdep.c (bad naming; used only for 4xx boards).diff -r1.22 -r1.23 src/sys/arch/evbppc/conf/files.obs405
(rin)
--- src/sys/arch/evbppc/conf/files.obs405 2021/03/29 13:38:31 1.22
+++ src/sys/arch/evbppc/conf/files.obs405 2021/03/30 02:41:14 1.23
@@ -1,17 +1,16 @@ | @@ -1,17 +1,16 @@ | |||
1 | # $NetBSD: files.obs405,v 1.22 2021/03/29 13:38:31 rin Exp $ | 1 | # $NetBSD: files.obs405,v 1.23 2021/03/30 02:41:14 rin Exp $ | |
2 | # | 2 | # | |
3 | # obs405-specific configuration info | 3 | # obs405-specific configuration info | |
4 | 4 | |||
5 | file arch/powerpc/ibm4xx/ibm4xx_autoconf.c | 5 | file arch/powerpc/ibm4xx/ibm4xx_autoconf.c | |
6 | file arch/powerpc/ibm4xx/ibm40x_machdep.c | 6 | file arch/powerpc/ibm4xx/ibm40x_machdep.c | |
7 | file arch/powerpc/ibm4xx/ibm4xx_machdep.c | 7 | file arch/powerpc/ibm4xx/ibm4xx_machdep.c | |
8 | file arch/evbppc/obs405/obs405_machdep.c | |||
9 | 8 | |||
10 | # Memory Disk for install kernel | 9 | # Memory Disk for install kernel | |
11 | file dev/md_root.c memory_disk_hooks | 10 | file dev/md_root.c memory_disk_hooks | |
12 | 11 | |||
13 | # Machine-independent SCSI drivers | 12 | # Machine-independent SCSI drivers | |
14 | include "dev/scsipi/files.scsipi" | 13 | include "dev/scsipi/files.scsipi" | |
15 | 14 | |||
16 | # Machine-independent ATA drivers | 15 | # Machine-independent ATA drivers | |
17 | include "dev/ata/files.ata" | 16 | include "dev/ata/files.ata" |
--- src/sys/arch/evbppc/evbppc/evbppc_machdep.c 2011/07/01 20:46:39 1.13
+++ src/sys/arch/evbppc/evbppc/evbppc_machdep.c 2021/03/30 02:41:14 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: evbppc_machdep.c,v 1.13 2011/07/01 20:46:39 dyoung Exp $ */ | 1 | /* $NetBSD: evbppc_machdep.c,v 1.14 2021/03/30 02:41:14 rin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright 2001, 2002 Wasabi Systems, Inc. | 4 | * Copyright 2001, 2002 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. | 7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -57,40 +57,51 @@ | @@ -57,40 +57,51 @@ | |||
57 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | 57 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | |
58 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 58 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
59 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 59 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
60 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 60 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
61 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 61 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
62 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 62 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
63 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 63 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
64 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 64 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
65 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 65 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
66 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
67 | */ | 67 | */ | |
68 | 68 | |||
69 | #include <sys/cdefs.h> | 69 | #include <sys/cdefs.h> | |
70 | __KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.13 2011/07/01 20:46:39 dyoung Exp $"); | 70 | __KERNEL_RCSID(0, "$NetBSD: evbppc_machdep.c,v 1.14 2021/03/30 02:41:14 rin Exp $"); | |
71 | 71 | |||
72 | #include <sys/param.h> | 72 | #include <sys/param.h> | |
73 | #include <sys/systm.h> | 73 | #include <sys/systm.h> | |
74 | #include <sys/mount.h> | 74 | #include <sys/mount.h> | |
75 | #include <sys/vnode.h> | 75 | #include <sys/vnode.h> | |
76 | 76 | |||
77 | #include <uvm/uvm_extern.h> | 77 | #include <uvm/uvm_extern.h> | |
78 | 78 | |||
79 | #include <machine/cpu.h> | 79 | #include <machine/cpu.h> | |
80 | #include <sys/bus.h> | 80 | #include <sys/bus.h> | |
81 | #include <machine/pmap.h> | 81 | #include <machine/pmap.h> | |
82 | 82 | |||
83 | /* | 83 | /* | |
84 | * Global variables used here and there. | |||
85 | */ | |||
86 | struct vm_map *phys_map = NULL; | |||
87 | ||||
88 | /* | |||
89 | * XXX This should probably be in autoconf. | |||
90 | */ | |||
91 | char machine[] = MACHINE; | |||
92 | char machine_arch[] = MACHINE_ARCH; | |||
93 | ||||
94 | /* | |||
84 | * ibm4xx kernels need to set module_machine to this for modules to work. | 95 | * ibm4xx kernels need to set module_machine to this for modules to work. | |
85 | */ | 96 | */ | |
86 | char module_machine_ibm4xx[] = "powerpc-ibm4xx"; | 97 | char module_machine_ibm4xx[] = "powerpc-ibm4xx"; | |
87 | 98 | |||
88 | int fake_mapiodev = 1; | 99 | int fake_mapiodev = 1; | |
89 | 100 | |||
90 | /* | 101 | /* | |
91 | * mapiodev: | 102 | * mapiodev: | |
92 | * | 103 | * | |
93 | * Allocate vm space and mapin the I/O address. Use reserved TLB | 104 | * Allocate vm space and mapin the I/O address. Use reserved TLB | |
94 | * mapping if one is found. | 105 | * mapping if one is found. | |
95 | */ | 106 | */ | |
96 | void * | 107 | void * |
--- src/sys/arch/evbppc/explora/machdep.c 2021/03/30 01:33:50 1.47
+++ src/sys/arch/evbppc/explora/machdep.c 2021/03/30 02:41:14 1.48
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.47 2021/03/30 01:33:50 rin Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.48 2021/03/30 02:41:14 rin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2003 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2003 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Juergen Hannken-Illjes. | 8 | * by Juergen Hannken-Illjes. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.47 2021/03/30 01:33:50 rin Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.48 2021/03/30 02:41:14 rin Exp $"); | |
34 | 34 | |||
35 | #include "opt_explora.h" | 35 | #include "opt_explora.h" | |
36 | #include "opt_modular.h" | 36 | #include "opt_modular.h" | |
37 | 37 | |||
38 | #include "ksyms.h" | 38 | #include "ksyms.h" | |
39 | 39 | |||
40 | #include <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | #include <sys/buf.h> | 42 | #include <sys/buf.h> | |
43 | #include <sys/msgbuf.h> | 43 | #include <sys/msgbuf.h> | |
44 | #include <sys/kernel.h> | 44 | #include <sys/kernel.h> | |
45 | #include <sys/mount.h> | 45 | #include <sys/mount.h> | |
46 | #include <sys/proc.h> | 46 | #include <sys/proc.h> | |
@@ -64,33 +64,28 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | @@ -64,33 +64,28 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | |||
64 | #include <powerpc/spr.h> | 64 | #include <powerpc/spr.h> | |
65 | #include <powerpc/ibm4xx/spr.h> | 65 | #include <powerpc/ibm4xx/spr.h> | |
66 | 66 | |||
67 | #include <powerpc/ibm4xx/cpu.h> | 67 | #include <powerpc/ibm4xx/cpu.h> | |
68 | #include <powerpc/ibm4xx/dcr403cgx.h> | 68 | #include <powerpc/ibm4xx/dcr403cgx.h> | |
69 | 69 | |||
70 | #if NKSYMS || defined(DDB) || defined(MODULAR) | 70 | #if NKSYMS || defined(DDB) || defined(MODULAR) | |
71 | #include <machine/db_machdep.h> | 71 | #include <machine/db_machdep.h> | |
72 | #include <ddb/db_extern.h> | 72 | #include <ddb/db_extern.h> | |
73 | #endif | 73 | #endif | |
74 | 74 | |||
75 | #define TLB_PG_SIZE (16*1024*1024) | 75 | #define TLB_PG_SIZE (16*1024*1024) | |
76 | 76 | |||
77 | char machine[] = MACHINE; /* from <machine/param.h> */ | |||
78 | char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ | |||
79 | ||||
80 | static const unsigned int cpuspeed = 66000000; | 77 | static const unsigned int cpuspeed = 66000000; | |
81 | 78 | |||
82 | struct vm_map *phys_map = NULL; | |||
83 | ||||
84 | void initppc(vaddr_t, vaddr_t); | 79 | void initppc(vaddr_t, vaddr_t); | |
85 | 80 | |||
86 | void | 81 | void | |
87 | initppc(vaddr_t startkernel, vaddr_t endkernel) | 82 | initppc(vaddr_t startkernel, vaddr_t endkernel) | |
88 | { | 83 | { | |
89 | u_int i, j, t, br[4]; | 84 | u_int i, j, t, br[4]; | |
90 | u_int maddr, msize, size; | 85 | u_int maddr, msize, size; | |
91 | 86 | |||
92 | br[0] = mfdcr(DCR_BR4); | 87 | br[0] = mfdcr(DCR_BR4); | |
93 | br[1] = mfdcr(DCR_BR5); | 88 | br[1] = mfdcr(DCR_BR5); | |
94 | br[2] = mfdcr(DCR_BR6); | 89 | br[2] = mfdcr(DCR_BR6); | |
95 | br[3] = mfdcr(DCR_BR7); | 90 | br[3] = mfdcr(DCR_BR7); | |
96 | 91 |
--- src/sys/arch/evbppc/virtex/machdep.c 2021/03/30 01:33:50 1.28
+++ src/sys/arch/evbppc/virtex/machdep.c 2021/03/30 02:41:14 1.29
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.28 2021/03/30 01:33:50 rin Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.29 2021/03/30 02:41:14 rin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2006 Jachym Holecek | 4 | * Copyright (c) 2006 Jachym Holecek | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written for DFC Design, s.r.o. | 7 | * Written for DFC Design, s.r.o. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * | 12 | * | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * Based on Walnut and Explora. | 33 | * Based on Walnut and Explora. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2021/03/30 01:33:50 rin Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.29 2021/03/30 02:41:14 rin Exp $"); | |
38 | 38 | |||
39 | #include "opt_compat_netbsd.h" | 39 | #include "opt_compat_netbsd.h" | |
40 | #include "opt_ddb.h" | 40 | #include "opt_ddb.h" | |
41 | #include "opt_virtex.h" | 41 | #include "opt_virtex.h" | |
42 | #include "opt_kgdb.h" | 42 | #include "opt_kgdb.h" | |
43 | 43 | |||
44 | #include <sys/param.h> | 44 | #include <sys/param.h> | |
45 | #include <sys/boot_flag.h> | 45 | #include <sys/boot_flag.h> | |
46 | #include <sys/buf.h> | 46 | #include <sys/buf.h> | |
47 | #include <sys/bus.h> | 47 | #include <sys/bus.h> | |
48 | #include <sys/device.h> | 48 | #include <sys/device.h> | |
49 | #include <sys/exec.h> | 49 | #include <sys/exec.h> | |
50 | #include <sys/malloc.h> | 50 | #include <sys/malloc.h> | |
@@ -78,37 +78,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | @@ -78,37 +78,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | |||
78 | #include <evbppc/virtex/virtex.h> | 78 | #include <evbppc/virtex/virtex.h> | |
79 | 79 | |||
80 | #include "ksyms.h" | 80 | #include "ksyms.h" | |
81 | 81 | |||
82 | #if defined(DDB) | 82 | #if defined(DDB) | |
83 | #include <powerpc/db_machdep.h> | 83 | #include <powerpc/db_machdep.h> | |
84 | #include <ddb/db_extern.h> | 84 | #include <ddb/db_extern.h> | |
85 | #endif | 85 | #endif | |
86 | 86 | |||
87 | #if defined(KGDB) | 87 | #if defined(KGDB) | |
88 | #include <sys/kgdb.h> | 88 | #include <sys/kgdb.h> | |
89 | #endif | 89 | #endif | |
90 | 90 | |||
91 | /* | |||
92 | * Global variables used here and there | |||
93 | */ | |||
94 | struct vm_map *phys_map = NULL; | |||
95 | ||||
96 | /* | |||
97 | * This should probably be in autoconf! XXX | |||
98 | */ | |||
99 | char machine[] = MACHINE; /* from <machine/param.h> */ | |||
100 | char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ | |||
101 | ||||
102 | void initppc(vaddr_t, vaddr_t); | 91 | void initppc(vaddr_t, vaddr_t); | |
103 | 92 | |||
104 | /* BSS segment start & end. */ | 93 | /* BSS segment start & end. */ | |
105 | extern char edata[], end[]; | 94 | extern char edata[], end[]; | |
106 | 95 | |||
107 | /* One region holds all memory, the other is terminator expected by 405 pmap. */ | 96 | /* One region holds all memory, the other is terminator expected by 405 pmap. */ | |
108 | #define MEMREGIONS 2 | 97 | #define MEMREGIONS 2 | |
109 | struct mem_region physmemr[MEMREGIONS]; | 98 | struct mem_region physmemr[MEMREGIONS]; | |
110 | struct mem_region availmemr[MEMREGIONS]; | 99 | struct mem_region availmemr[MEMREGIONS]; | |
111 | 100 | |||
112 | /* Maximum TLB page size. */ | 101 | /* Maximum TLB page size. */ | |
113 | #define TLB_PG_SIZE (16*1024*1024) | 102 | #define TLB_PG_SIZE (16*1024*1024) | |
114 | 103 |
--- src/sys/arch/evbppc/walnut/machdep.c 2021/03/30 02:04:44 1.65
+++ src/sys/arch/evbppc/walnut/machdep.c 2021/03/30 02:41:15 1.66
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.65 2021/03/30 02:04:44 rin Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.66 2021/03/30 02:41:15 rin Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright 2001, 2002 Wasabi Systems, Inc. | 4 | * Copyright 2001, 2002 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. | 7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -57,27 +57,27 @@ | @@ -57,27 +57,27 @@ | |||
57 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | 57 | * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR | |
58 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 58 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
59 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 59 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
60 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 60 | * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
61 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 61 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
62 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 62 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
63 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 63 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
64 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 64 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
65 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 65 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
66 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
67 | */ | 67 | */ | |
68 | 68 | |||
69 | #include <sys/cdefs.h> | 69 | #include <sys/cdefs.h> | |
70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.65 2021/03/30 02:04:44 rin Exp $"); | 70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.66 2021/03/30 02:41:15 rin Exp $"); | |
71 | 71 | |||
72 | #include "opt_compat_netbsd.h" | 72 | #include "opt_compat_netbsd.h" | |
73 | #include "opt_ddb.h" | 73 | #include "opt_ddb.h" | |
74 | 74 | |||
75 | #include <sys/param.h> | 75 | #include <sys/param.h> | |
76 | #include <sys/boot_flag.h> | 76 | #include <sys/boot_flag.h> | |
77 | #include <sys/buf.h> | 77 | #include <sys/buf.h> | |
78 | #include <sys/bus.h> | 78 | #include <sys/bus.h> | |
79 | #include <sys/cpu.h> | 79 | #include <sys/cpu.h> | |
80 | #include <sys/device.h> | 80 | #include <sys/device.h> | |
81 | #include <sys/exec.h> | 81 | #include <sys/exec.h> | |
82 | #include <sys/kernel.h> | 82 | #include <sys/kernel.h> | |
83 | #include <sys/ksyms.h> | 83 | #include <sys/ksyms.h> | |
@@ -118,37 +118,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | @@ -118,37 +118,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v | |||
118 | #include <dev/pci/pcivar.h> | 118 | #include <dev/pci/pcivar.h> | |
119 | #include <dev/pci/pciconf.h> | 119 | #include <dev/pci/pciconf.h> | |
120 | 120 | |||
121 | #include "ksyms.h" | 121 | #include "ksyms.h" | |
122 | 122 | |||
123 | #if defined(DDB) | 123 | #if defined(DDB) | |
124 | #include <powerpc/db_machdep.h> | 124 | #include <powerpc/db_machdep.h> | |
125 | #include <ddb/db_extern.h> | 125 | #include <ddb/db_extern.h> | |
126 | #endif | 126 | #endif | |
127 | 127 | |||
128 | 128 | |||
129 | #define TLB_PG_SIZE (16*1024*1024) | 129 | #define TLB_PG_SIZE (16*1024*1024) | |
130 | 130 | |||
131 | /* | |||
132 | * Global variables used here and there | |||
133 | */ | |||
134 | struct vm_map *phys_map = NULL; | |||
135 | ||||
136 | /* | |||
137 | * This should probably be in autoconf! XXX | |||
138 | */ | |||
139 | char machine[] = MACHINE; /* from <machine/param.h> */ | |||
140 | char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ | |||
141 | ||||
142 | void initppc(vaddr_t, vaddr_t, char *, void *); | 131 | void initppc(vaddr_t, vaddr_t, char *, void *); | |
143 | 132 | |||
144 | void | 133 | void | |
145 | initppc(vaddr_t startkernel, vaddr_t endkernel, char *args, void *info_block) | 134 | initppc(vaddr_t startkernel, vaddr_t endkernel, char *args, void *info_block) | |
146 | { | 135 | { | |
147 | u_int memsize; | 136 | u_int memsize; | |
148 | 137 | |||
149 | /* Disable all external interrupts */ | 138 | /* Disable all external interrupts */ | |
150 | mtdcr(DCR_UIC0_BASE + DCR_UIC_ER, 0); | 139 | mtdcr(DCR_UIC0_BASE + DCR_UIC_ER, 0); | |
151 | 140 | |||
152 | /* Setup board from OpenBIOS */ | 141 | /* Setup board from OpenBIOS */ | |
153 | openbios_board_init(info_block); | 142 | openbios_board_init(info_block); | |
154 | memsize = openbios_board_memsize_get(); | 143 | memsize = openbios_board_memsize_get(); |