Fix various build with the 32bit mips ports after the mips64 merge.diff -r1.118 -r1.119 src/sys/arch/arc/arc/machdep.c
(matt)
--- src/sys/arch/arc/arc/machdep.c 2009/11/27 03:23:04 1.118
+++ src/sys/arch/arc/arc/machdep.c 2009/12/16 23:19:06 1.119
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.118 2009/11/27 03:23:04 rmind Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.119 2009/12/16 23:19:06 matt Exp $ */ | |
2 | /* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */ | 2 | /* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 1992, 1993 | 5 | * Copyright (c) 1992, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to Berkeley by | 8 | * This code is derived from software contributed to Berkeley by | |
9 | * the Systems Programming Group of the University of Utah Computer | 9 | * the Systems Programming Group of the University of Utah Computer | |
10 | * Science Department, The Mach Operating System project at | 10 | * Science Department, The Mach Operating System project at | |
11 | * Carnegie-Mellon University and Ralph Campbell. | 11 | * Carnegie-Mellon University and Ralph Campbell. | |
12 | * | 12 | * | |
13 | * Redistribution and use in source and binary forms, with or without | 13 | * Redistribution and use in source and binary forms, with or without | |
14 | * modification, are permitted provided that the following conditions | 14 | * modification, are permitted provided that the following conditions | |
@@ -68,27 +68,27 @@ | @@ -68,27 +68,27 @@ | |||
68 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 68 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
69 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 69 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
70 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 70 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
71 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 71 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
72 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 72 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
73 | * SUCH DAMAGE. | 73 | * SUCH DAMAGE. | |
74 | * | 74 | * | |
75 | * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 | 75 | * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 | |
76 | */ | 76 | */ | |
77 | 77 | |||
78 | /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ | 78 | /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ | |
79 | 79 | |||
80 | #include <sys/cdefs.h> | 80 | #include <sys/cdefs.h> | |
81 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2009/11/27 03:23:04 rmind Exp $"); | 81 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.119 2009/12/16 23:19:06 matt Exp $"); | |
82 | 82 | |||
83 | #include "fs_mfs.h" | 83 | #include "fs_mfs.h" | |
84 | #include "opt_ddb.h" | 84 | #include "opt_ddb.h" | |
85 | #include "opt_ddbparam.h" | 85 | #include "opt_ddbparam.h" | |
86 | #include "opt_md.h" | 86 | #include "opt_md.h" | |
87 | #include "opt_modular.h" | 87 | #include "opt_modular.h" | |
88 | 88 | |||
89 | #include <sys/param.h> | 89 | #include <sys/param.h> | |
90 | #include <sys/systm.h> | 90 | #include <sys/systm.h> | |
91 | #include <sys/signalvar.h> | 91 | #include <sys/signalvar.h> | |
92 | #include <sys/kernel.h> | 92 | #include <sys/kernel.h> | |
93 | #include <sys/proc.h> | 93 | #include <sys/proc.h> | |
94 | #include <sys/buf.h> | 94 | #include <sys/buf.h> | |
@@ -221,28 +221,26 @@ extern char kernel_text[], edata[], end[ | @@ -221,28 +221,26 @@ extern char kernel_text[], edata[], end[ | |||
221 | /* | 221 | /* | |
222 | * Do all the stuff that locore normally does before calling main(). | 222 | * Do all the stuff that locore normally does before calling main(). | |
223 | * Process arguments passed to us by the BIOS. | 223 | * Process arguments passed to us by the BIOS. | |
224 | * Reset mapping and set up mapping to hardware and init "wired" reg. | 224 | * Reset mapping and set up mapping to hardware and init "wired" reg. | |
225 | * Return the first page address following the system. | 225 | * Return the first page address following the system. | |
226 | */ | 226 | */ | |
227 | void | 227 | void | |
228 | mach_init(int argc, char *argv[], u_int bim, void *bip) | 228 | mach_init(int argc, char *argv[], u_int bim, void *bip) | |
229 | { | 229 | { | |
230 | const char *cp; | 230 | const char *cp; | |
231 | int i; | 231 | int i; | |
232 | paddr_t kernstartpfn, kernendpfn, first, last; | 232 | paddr_t kernstartpfn, kernendpfn, first, last; | |
233 | char *kernend; | 233 | char *kernend; | |
234 | struct pcb *pcb0; | |||
235 | vaddr_t v; | |||
236 | #if NKSYMS > 0 || defined(DDB) || defined(MODULAR) | 234 | #if NKSYMS > 0 || defined(DDB) || defined(MODULAR) | |
237 | char *ssym = NULL; | 235 | char *ssym = NULL; | |
238 | char *esym = NULL; | 236 | char *esym = NULL; | |
239 | struct btinfo_symtab *bi_syms; | 237 | struct btinfo_symtab *bi_syms; | |
240 | #endif | 238 | #endif | |
241 | 239 | |||
242 | /* set up bootinfo structures */ | 240 | /* set up bootinfo structures */ | |
243 | if (bim == BOOTINFO_MAGIC && bip != NULL) { | 241 | if (bim == BOOTINFO_MAGIC && bip != NULL) { | |
244 | struct btinfo_magic *bi_magic; | 242 | struct btinfo_magic *bi_magic; | |
245 | 243 | |||
246 | memcpy(bi_buf, bip, BOOTINFO_SIZE); | 244 | memcpy(bi_buf, bip, BOOTINFO_SIZE); | |
247 | bootinfo = bi_buf; | 245 | bootinfo = bi_buf; | |
248 | bi_magic = lookup_bootinfo(BTINFO_MAGIC); | 246 | bi_magic = lookup_bootinfo(BTINFO_MAGIC); | |
@@ -481,33 +479,28 @@ mach_init(int argc, char *argv[], u_int | @@ -481,33 +479,28 @@ mach_init(int argc, char *argv[], u_int | |||
481 | /* | 479 | /* | |
482 | * Initialize error message buffer (at end of core). | 480 | * Initialize error message buffer (at end of core). | |
483 | */ | 481 | */ | |
484 | mips_init_msgbuf(); | 482 | mips_init_msgbuf(); | |
485 | 483 | |||
486 | /* | 484 | /* | |
487 | * Initialize the virtual memory system. | 485 | * Initialize the virtual memory system. | |
488 | */ | 486 | */ | |
489 | pmap_bootstrap(); | 487 | pmap_bootstrap(); | |
490 | 488 | |||
491 | /* | 489 | /* | |
492 | * Allocate uarea page for lwp0 and set it. | 490 | * Allocate uarea page for lwp0 and set it. | |
493 | */ | 491 | */ | |
494 | v = uvm_pageboot_alloc(USPACE); | 492 | mips_init_lwp0_uarea(); | |
495 | uvm_lwp_setuarea(&lwp0, v); | |||
496 | 493 | |||
497 | pcb0 = lwp_getpcb(&lwp0); | |||
498 | pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ | |||
499 | ||||
500 | lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; | |||
501 | } | 494 | } | |
502 | 495 | |||
503 | void | 496 | void | |
504 | mips_machdep_cache_config(void) | 497 | mips_machdep_cache_config(void) | |
505 | { | 498 | { | |
506 | 499 | |||
507 | mips_sdcache_size = arc_cpu_l2cache_size; | 500 | mips_sdcache_size = arc_cpu_l2cache_size; | |
508 | } | 501 | } | |
509 | 502 | |||
510 | /* | 503 | /* | |
511 | * Return a pointer to the given environment variable. | 504 | * Return a pointer to the given environment variable. | |
512 | */ | 505 | */ | |
513 | const char * | 506 | const char * |
--- src/sys/arch/arc/arc/wired_map_machdep.c 2007/02/22 05:09:01 1.5
+++ src/sys/arch/arc/arc/wired_map_machdep.c 2009/12/16 23:19:06 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: wired_map_machdep.c,v 1.5 2007/02/22 05:09:01 thorpej Exp $ */ | 1 | /* $NetBSD: wired_map_machdep.c,v 1.6 2009/12/16 23:19:06 matt Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (C) 2000 Shuichiro URATA. All rights reserved. | 4 | * Copyright (C) 2000 Shuichiro URATA. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. The name of the author may not be used to endorse or promote products | 14 | * 3. The name of the author may not be used to endorse or promote products | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: wired_map_machdep.c,v 1.5 2007/02/22 05:09:01 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: wired_map_machdep.c,v 1.6 2009/12/16 23:19:06 matt Exp $"); | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/systm.h> | 33 | #include <sys/systm.h> | |
34 | #include <sys/malloc.h> | 34 | #include <sys/malloc.h> | |
35 | #include <sys/extent.h> | 35 | #include <sys/extent.h> | |
36 | 36 | |||
37 | #include <uvm/uvm_extern.h> | 37 | #include <uvm/uvm_extern.h> | |
38 | #include <machine/cpu.h> | 38 | #include <machine/cpu.h> | |
39 | #include <machine/wired_map.h> | 39 | #include <machine/wired_map.h> | |
40 | #include <machine/vmparam.h> | 40 | #include <machine/vmparam.h> | |
41 | #include <mips/locore.h> | 41 | #include <mips/locore.h> | |
42 | #include <mips/pte.h> | 42 | #include <mips/pte.h> | |
43 | 43 | |||
@@ -159,41 +159,41 @@ arc_contiguously_wired_mapped(paddr_t pa | @@ -159,41 +159,41 @@ arc_contiguously_wired_mapped(paddr_t pa | |||
159 | size -= vsize; | 159 | size -= vsize; | |
160 | if (size <= 0) | 160 | if (size <= 0) | |
161 | break; | 161 | break; | |
162 | if (!arc_wired_map_vaddr_entry(va, &p, &vsize) || p != pa) | 162 | if (!arc_wired_map_vaddr_entry(va, &p, &vsize) || p != pa) | |
163 | return 0; /* not contiguously wired mapped */ | 163 | return 0; /* not contiguously wired mapped */ | |
164 | } | 164 | } | |
165 | return rva + offset; | 165 | return rva + offset; | |
166 | } | 166 | } | |
167 | 167 | |||
168 | /* Allocate new wired entries */ | 168 | /* Allocate new wired entries */ | |
169 | vaddr_t | 169 | vaddr_t | |
170 | arc_map_wired(paddr_t pa, vsize_t size) | 170 | arc_map_wired(paddr_t pa, vsize_t size) | |
171 | { | 171 | { | |
172 | vaddr_t va; | 172 | u_long va; | |
173 | vsize_t off; | 173 | vsize_t off; | |
174 | int error; | 174 | int error; | |
175 | 175 | |||
176 | /* XXX: may be already partially wired mapped */ | 176 | /* XXX: may be already partially wired mapped */ | |
177 | 177 | |||
178 | off = pa & MIPS3_WIRED_OFFMASK; | 178 | off = pa & MIPS3_WIRED_OFFMASK; | |
179 | pa &= ~(paddr_t)MIPS3_WIRED_OFFMASK; | 179 | pa &= ~(paddr_t)MIPS3_WIRED_OFFMASK; | |
180 | size += off; | 180 | size += off; | |
181 | 181 | |||
182 | if ((size + MIPS3_WIRED_ENTRY_SIZE(MIPS3_WIRED_SIZE) - 1) / | 182 | if ((size + MIPS3_WIRED_ENTRY_SIZE(MIPS3_WIRED_SIZE) - 1) / | |
183 | MIPS3_WIRED_ENTRY_SIZE(MIPS3_WIRED_SIZE) > | 183 | MIPS3_WIRED_ENTRY_SIZE(MIPS3_WIRED_SIZE) > | |
184 | MIPS3_NWIRED_ENTRY - mips3_nwired_page) { | 184 | MIPS3_NWIRED_ENTRY - mips3_nwired_page) { | |
185 | #ifdef DIAGNOSTIC | 185 | #ifdef DIAGNOSTIC | |
186 | printf("arc_map_wired(0x%llx, 0x%lx): %d is not enough\n", | 186 | printf("arc_map_wired(0x%"PRIxPADDR", 0x%"PRIxVSIZE"): %d is not enough\n", | |
187 | pa + off, size - off, | 187 | pa + off, size - off, | |
188 | MIPS3_NWIRED_ENTRY - mips3_nwired_page); | 188 | MIPS3_NWIRED_ENTRY - mips3_nwired_page); | |
189 | #endif | 189 | #endif | |
190 | return 0; /* free wired TLB is not enough */ | 190 | return 0; /* free wired TLB is not enough */ | |
191 | } | 191 | } | |
192 | 192 | |||
193 | error = extent_alloc(arc_wired_map_ex, size, MIPS3_WIRED_SIZE, | 193 | error = extent_alloc(arc_wired_map_ex, size, MIPS3_WIRED_SIZE, | |
194 | 0, EX_NOWAIT, &va); | 194 | 0, EX_NOWAIT, &va); | |
195 | if (error) { | 195 | if (error) { | |
196 | #ifdef DIAGNOSTIC | 196 | #ifdef DIAGNOSTIC | |
197 | printf("arc_map_wired: can't allocate region\n"); | 197 | printf("arc_map_wired: can't allocate region\n"); | |
198 | #endif | 198 | #endif | |
199 | return 0; | 199 | return 0; |
--- src/sys/arch/arc/include/elf_machdep.h 2000/01/31 15:51:35 1.4
+++ src/sys/arch/arc/include/elf_machdep.h 2009/12/16 23:19:06 1.5
@@ -1,11 +1,3 @@ | @@ -1,11 +1,3 @@ | |||
1 | /* $NetBSD: elf_machdep.h,v 1.4 2000/01/31 15:51:35 soda Exp $ */ | 1 | /* $NetBSD: elf_machdep.h,v 1.5 2009/12/16 23:19:06 matt Exp $ */ | |
2 | 2 | |||
3 | #include <mips/elf_machdep.h> | 3 | #include <mips/elf_machdep.h> | |
4 | ||||
5 | /* | |||
6 | * arc is mipsel platform | |||
7 | */ | |||
8 | ||||
9 | #define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB | |||
10 | ||||
11 | #define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */ |
--- src/sys/arch/arc/include/vmparam.h 2005/12/11 12:16:39 1.9
+++ src/sys/arch/arc/include/vmparam.h 2009/12/16 23:19:06 1.10
@@ -1,26 +1,24 @@ | @@ -1,26 +1,24 @@ | |||
1 | /* $NetBSD: vmparam.h,v 1.9 2005/12/11 12:16:39 christos Exp $ */ | 1 | /* $NetBSD: vmparam.h,v 1.10 2009/12/16 23:19:06 matt Exp $ */ | |
2 | /* $OpenBSD: vmparam.h,v 1.3 1997/04/19 17:19:59 pefo Exp $ */ | 2 | /* $OpenBSD: vmparam.h,v 1.3 1997/04/19 17:19:59 pefo Exp $ */ | |
3 | /* NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp */ | 3 | /* NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp */ | |
4 | 4 | |||
5 | #include <mips/vmparam.h> | 5 | #include <mips/vmparam.h> | |
6 | 6 | |||
7 | /* VA 0xe0000000-0xffffffff is used for wired_map TLB entries. */ | 7 | /* VA 0xe0000000-0xffffffff is used for wired_map TLB entries. */ | |
8 | #undef VM_MAX_KERNEL_ADDRESS | 8 | #undef VM_MAX_KERNEL_ADDRESS | |
9 | #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xDFFFF000) | 9 | #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xDFFFF000) | |
10 | 10 | |||
11 | #define VM_MIN_WIRED_MAP_ADDRESS ((vaddr_t)0xE0000000) | 11 | #define VM_MIN_WIRED_MAP_ADDRESS ((vaddr_t)0xE0000000) | |
12 | #define VM_MAX_WIRED_MAP_ADDRESS ((vaddr_t)0xFFFFC000) | 12 | #define VM_MAX_WIRED_MAP_ADDRESS ((vaddr_t)0xFFFFC000) | |
13 | 13 | |||
14 | /* | 14 | /* | |
15 | * Maximum number of contigous physical memory segment. | 15 | * Maximum number of contigous physical memory segment. | |
16 | */ | 16 | */ | |
17 | #undef VM_PHYSSEG_MAX | |||
17 | #define VM_PHYSSEG_MAX 16 | 18 | #define VM_PHYSSEG_MAX 16 | |
18 | 19 | |||
19 | #define VM_NFREELIST 1 | |||
20 | #define VM_FREELIST_DEFAULT 0 | |||
21 | ||||
22 | #ifndef KSEG2IOBUFSIZE | 20 | #ifndef KSEG2IOBUFSIZE | |
23 | #define KSEG2IOBUFSIZE kseg2iobufsize /* reserve PTEs for KSEG2 I/O space */ | 21 | #define KSEG2IOBUFSIZE kseg2iobufsize /* reserve PTEs for KSEG2 I/O space */ | |
24 | 22 | |||
25 | extern vsize_t kseg2iobufsize; | 23 | extern vsize_t kseg2iobufsize; | |
26 | #endif | 24 | #endif |
--- src/sys/arch/arc/isa/isabus.c 2009/11/27 03:23:04 1.46
+++ src/sys/arch/arc/isa/isabus.c 2009/12/16 23:19:07 1.47
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: isabus.c,v 1.46 2009/11/27 03:23:04 rmind Exp $ */ | 1 | /* $NetBSD: isabus.c,v 1.47 2009/12/16 23:19:07 matt Exp $ */ | |
2 | /* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */ | 2 | /* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */ | |
3 | /* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */ | 3 | /* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */ | |
4 | 4 | |||
5 | /*- | 5 | /*- | |
6 | * Copyright (c) 1990 The Regents of the University of California. | 6 | * Copyright (c) 1990 The Regents of the University of California. | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * This code is derived from software contributed to Berkeley by | 9 | * This code is derived from software contributed to Berkeley by | |
10 | * William Jolitz and Don Ahn. | 10 | * William Jolitz and Don Ahn. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -110,27 +110,27 @@ appear in supporting documentation, and | @@ -110,27 +110,27 @@ appear in supporting documentation, and | |||
110 | not be used in advertising or publicity pertaining to distribution | 110 | not be used in advertising or publicity pertaining to distribution | |
111 | of the software without specific, written prior permission. | 111 | of the software without specific, written prior permission. | |
112 | 112 | |||
113 | INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE | 113 | INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE | |
114 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, | 114 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, | |
115 | IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR | 115 | IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR | |
116 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | 116 | CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | |
117 | LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, | 117 | LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, | |
118 | NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | 118 | NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | |
119 | WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 119 | WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
120 | */ | 120 | */ | |
121 | 121 | |||
122 | #include <sys/cdefs.h> | 122 | #include <sys/cdefs.h> | |
123 | __KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.46 2009/11/27 03:23:04 rmind Exp $"); | 123 | __KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.47 2009/12/16 23:19:07 matt Exp $"); | |
124 | 124 | |||
125 | #include <sys/param.h> | 125 | #include <sys/param.h> | |
126 | #include <sys/proc.h> | 126 | #include <sys/proc.h> | |
127 | #include <sys/systm.h> | 127 | #include <sys/systm.h> | |
128 | #include <sys/callout.h> | 128 | #include <sys/callout.h> | |
129 | #include <sys/time.h> | 129 | #include <sys/time.h> | |
130 | #include <sys/kernel.h> | 130 | #include <sys/kernel.h> | |
131 | #include <sys/device.h> | 131 | #include <sys/device.h> | |
132 | #include <sys/malloc.h> | 132 | #include <sys/malloc.h> | |
133 | #include <sys/extent.h> | 133 | #include <sys/extent.h> | |
134 | 134 | |||
135 | #include <uvm/uvm_extern.h> | 135 | #include <uvm/uvm_extern.h> | |
136 | 136 | |||
@@ -206,27 +206,27 @@ isabrattach(struct isabr_softc *sc) | @@ -206,27 +206,27 @@ isabrattach(struct isabr_softc *sc) | |||
206 | iba.iba_iot = &arc_bus_io; | 206 | iba.iba_iot = &arc_bus_io; | |
207 | iba.iba_memt = &arc_bus_mem; | 207 | iba.iba_memt = &arc_bus_mem; | |
208 | iba.iba_dmat = &sc->sc_dmat; | 208 | iba.iba_dmat = &sc->sc_dmat; | |
209 | iba.iba_ic = &sc->arc_isa_cs; | 209 | iba.iba_ic = &sc->arc_isa_cs; | |
210 | config_found_ia(sc->sc_dev, "isabus", &iba, isabrprint); | 210 | config_found_ia(sc->sc_dev, "isabus", &iba, isabrprint); | |
211 | } | 211 | } | |
212 | 212 | |||
213 | static int | 213 | static int | |
214 | isabrprint(void *aux, const char *pnp) | 214 | isabrprint(void *aux, const char *pnp) | |
215 | { | 215 | { | |
216 | 216 | |||
217 | if (pnp) | 217 | if (pnp) | |
218 | aprint_normal("isa at %s", pnp); | 218 | aprint_normal("isa at %s", pnp); | |
219 | aprint_verbose(" isa_io_base 0x%lx isa_mem_base 0x%lx", | 219 | aprint_verbose(" isa_io_base 0x%"PRIxVADDR" isa_mem_base 0x%"PRIxVADDR, | |
220 | arc_bus_io.bs_vbase, arc_bus_mem.bs_vbase); | 220 | arc_bus_io.bs_vbase, arc_bus_mem.bs_vbase); | |
221 | return UNCONF; | 221 | return UNCONF; | |
222 | } | 222 | } | |
223 | 223 | |||
224 | 224 | |||
225 | /* | 225 | /* | |
226 | * Interrupt system driver code | 226 | * Interrupt system driver code | |
227 | * ============================ | 227 | * ============================ | |
228 | */ | 228 | */ | |
229 | #define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2) | 229 | #define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2) | |
230 | 230 | |||
231 | int imen; | 231 | int imen; | |
232 | int intrtype[ICU_LEN], intrmask[ICU_LEN], intrlevel[ICU_LEN]; | 232 | int intrtype[ICU_LEN], intrmask[ICU_LEN], intrlevel[ICU_LEN]; |
--- src/sys/arch/hpcmips/hpcmips/machdep.c 2009/12/14 00:46:04 1.106
+++ src/sys/arch/hpcmips/hpcmips/machdep.c 2009/12/16 23:19:07 1.107
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.106 2009/12/14 00:46:04 matt Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.107 2009/12/16 23:19:07 matt Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1999 Shin Takemura, All rights reserved. | 4 | * Copyright (c) 1999 Shin Takemura, All rights reserved. | |
5 | * Copyright (c) 1999-2001 SATO Kazumi, All rights reserved. | 5 | * Copyright (c) 1999-2001 SATO Kazumi, All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -98,27 +98,27 @@ | @@ -98,27 +98,27 @@ | |||
98 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 98 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
99 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 99 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
101 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 101 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
102 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 102 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
103 | * SUCH DAMAGE. | 103 | * SUCH DAMAGE. | |
104 | * | 104 | * | |
105 | * from: Utah Hdr: machdep.c 1.63 91/04/24 | 105 | * from: Utah Hdr: machdep.c 1.63 91/04/24 | |
106 | * | 106 | * | |
107 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | 107 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | |
108 | */ | 108 | */ | |
109 | 109 | |||
110 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | 110 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | |
111 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.106 2009/12/14 00:46:04 matt Exp $"); | 111 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.107 2009/12/16 23:19:07 matt Exp $"); | |
112 | 112 | |||
113 | #include "opt_vr41xx.h" | 113 | #include "opt_vr41xx.h" | |
114 | #include "opt_tx39xx.h" | 114 | #include "opt_tx39xx.h" | |
115 | #include "opt_boot_standalone.h" | 115 | #include "opt_boot_standalone.h" | |
116 | #include "opt_modular.h" | 116 | #include "opt_modular.h" | |
117 | #include "opt_spec_platform.h" | 117 | #include "opt_spec_platform.h" | |
118 | #include "biconsdev.h" | 118 | #include "biconsdev.h" | |
119 | #include "fs_mfs.h" | 119 | #include "fs_mfs.h" | |
120 | #include "opt_ddb.h" | 120 | #include "opt_ddb.h" | |
121 | #include "opt_kgdb.h" | 121 | #include "opt_kgdb.h" | |
122 | #include "opt_rtc_offset.h" | 122 | #include "opt_rtc_offset.h" | |
123 | #include "fs_nfs.h" | 123 | #include "fs_nfs.h" | |
124 | #include "opt_kloader.h" | 124 | #include "opt_kloader.h" | |
@@ -253,27 +253,26 @@ mach_init(int argc, char *argv[], struct | @@ -253,27 +253,26 @@ mach_init(int argc, char *argv[], struct | |||
253 | { | 253 | { | |
254 | /* | 254 | /* | |
255 | * this routines stack is never polluted since stack pointer | 255 | * this routines stack is never polluted since stack pointer | |
256 | * is lower than kernel text segment, and at exiting, stack pointer | 256 | * is lower than kernel text segment, and at exiting, stack pointer | |
257 | * is changed to proc0. | 257 | * is changed to proc0. | |
258 | */ | 258 | */ | |
259 | #ifdef KLOADER | 259 | #ifdef KLOADER | |
260 | struct kloader_bootinfo kbi; | 260 | struct kloader_bootinfo kbi; | |
261 | #endif | 261 | #endif | |
262 | extern char edata[], end[]; | 262 | extern char edata[], end[]; | |
263 | #if NKSYMS || defined(DDB) || defined(MODULAR) | 263 | #if NKSYMS || defined(DDB) || defined(MODULAR) | |
264 | extern void *esym; | 264 | extern void *esym; | |
265 | #endif | 265 | #endif | |
266 | struct pcb *pcb0; | |||
267 | void *kernend; | 266 | void *kernend; | |
268 | char *cp; | 267 | char *cp; | |
269 | int i; | 268 | int i; | |
270 | 269 | |||
271 | /* clear the BSS segment */ | 270 | /* clear the BSS segment */ | |
272 | #if NKSYMS || defined(DDB) || defined(MODULAR) | 271 | #if NKSYMS || defined(DDB) || defined(MODULAR) | |
273 | size_t symbolsz = 0; | 272 | size_t symbolsz = 0; | |
274 | Elf_Ehdr *eh = (void *)end; | 273 | Elf_Ehdr *eh = (void *)end; | |
275 | if (memcmp(eh->e_ident, ELFMAG, SELFMAG) == 0 && | 274 | if (memcmp(eh->e_ident, ELFMAG, SELFMAG) == 0 && | |
276 | eh->e_ident[EI_CLASS] == ELFCLASS) { | 275 | eh->e_ident[EI_CLASS] == ELFCLASS) { | |
277 | esym = end; | 276 | esym = end; | |
278 | #ifndef NO_SYMBOLSZ_ENTRY | 277 | #ifndef NO_SYMBOLSZ_ENTRY | |
279 | if (eh->e_entry != 0) { | 278 | if (eh->e_entry != 0) { |
--- src/sys/arch/mipsco/mipsco/machdep.c 2009/11/27 03:23:11 1.69
+++ src/sys/arch/mipsco/mipsco/machdep.c 2009/12/16 23:19:07 1.70
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.69 2009/11/27 03:23:11 rmind Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.70 2009/12/16 23:19:07 matt Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1992, 1993 | 4 | * Copyright (c) 1992, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department, The Mach Operating System project at | 9 | * Science Department, The Mach Operating System project at | |
10 | * Carnegie-Mellon University and Ralph Campbell. | 10 | * Carnegie-Mellon University and Ralph Campbell. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -66,27 +66,27 @@ | @@ -66,27 +66,27 @@ | |||
66 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 66 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
72 | * SUCH DAMAGE. | 72 | * SUCH DAMAGE. | |
73 | * | 73 | * | |
74 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | 74 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | |
75 | */ | 75 | */ | |
76 | 76 | |||
77 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | 77 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | |
78 | 78 | |||
79 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/11/27 03:23:11 rmind Exp $"); | 79 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.70 2009/12/16 23:19:07 matt Exp $"); | |
80 | 80 | |||
81 | /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ | 81 | /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ | |
82 | 82 | |||
83 | #include "opt_ddb.h" | 83 | #include "opt_ddb.h" | |
84 | #include "opt_kgdb.h" | 84 | #include "opt_kgdb.h" | |
85 | #include "opt_modular.h" | 85 | #include "opt_modular.h" | |
86 | 86 | |||
87 | #include <sys/param.h> | 87 | #include <sys/param.h> | |
88 | #include <sys/systm.h> | 88 | #include <sys/systm.h> | |
89 | #include <sys/signalvar.h> | 89 | #include <sys/signalvar.h> | |
90 | #include <sys/kernel.h> | 90 | #include <sys/kernel.h> | |
91 | #include <sys/proc.h> | 91 | #include <sys/proc.h> | |
92 | #include <sys/buf.h> | 92 | #include <sys/buf.h> | |
@@ -219,29 +219,27 @@ struct consdev consdev_prom = { | @@ -219,29 +219,27 @@ struct consdev consdev_prom = { | |||
219 | null_cnpollc, | 219 | null_cnpollc, | |
220 | }; | 220 | }; | |
221 | 221 | |||
222 | 222 | |||
223 | /* | 223 | /* | |
224 | * Do all the stuff that locore normally does before calling main(). | 224 | * Do all the stuff that locore normally does before calling main(). | |
225 | * Process arguments passed to us by the prom monitor. | 225 | * Process arguments passed to us by the prom monitor. | |
226 | * Return the first page address following the system. | 226 | * Return the first page address following the system. | |
227 | */ | 227 | */ | |
228 | void | 228 | void | |
229 | mach_init(int argc, char *argv[], char *envp[], u_int bim, char *bip) | 229 | mach_init(int argc, char *argv[], char *envp[], u_int bim, char *bip) | |
230 | { | 230 | { | |
231 | u_long first, last; | 231 | u_long first, last; | |
232 | struct pcb *pcb0; | |||
233 | char *kernend; | 232 | char *kernend; | |
234 | vaddr_t v; | |||
235 | char *cp; | 233 | char *cp; | |
236 | int i, howto; | 234 | int i, howto; | |
237 | extern char edata[], end[]; | 235 | extern char edata[], end[]; | |
238 | const char *bi_msg; | 236 | const char *bi_msg; | |
239 | #if NKSYMS || defined(DDB) || defined(MODULAR) | 237 | #if NKSYMS || defined(DDB) || defined(MODULAR) | |
240 | int nsym = 0; | 238 | int nsym = 0; | |
241 | char *ssym = 0; | 239 | char *ssym = 0; | |
242 | char *esym = 0; | 240 | char *esym = 0; | |
243 | struct btinfo_symtab *bi_syms; | 241 | struct btinfo_symtab *bi_syms; | |
244 | #endif | 242 | #endif | |
245 | 243 | |||
246 | 244 | |||
247 | /* Check for valid bootinfo passed from bootstrap */ | 245 | /* Check for valid bootinfo passed from bootstrap */ | |
@@ -360,33 +358,27 @@ mach_init(int argc, char *argv[], char * | @@ -360,33 +358,27 @@ mach_init(int argc, char *argv[], char * | |||
360 | /* | 358 | /* | |
361 | * Initialize error message buffer (at end of core). | 359 | * Initialize error message buffer (at end of core). | |
362 | */ | 360 | */ | |
363 | mips_init_msgbuf(); | 361 | mips_init_msgbuf(); | |
364 | 362 | |||
365 | /* | 363 | /* | |
366 | * Initialize the virtual memory system. | 364 | * Initialize the virtual memory system. | |
367 | */ | 365 | */ | |
368 | pmap_bootstrap(); | 366 | pmap_bootstrap(); | |
369 | 367 | |||
370 | /* | 368 | /* | |
371 | * Allocate uarea page for lwp0 and set it. | 369 | * Allocate uarea page for lwp0 and set it. | |
372 | */ | 370 | */ | |
373 | v = uvm_pageboot_alloc(USPACE); | 371 | mips_init_lwp0_uarea(); | |
374 | uvm_lwp_setuarea(&lwp0, v); | |||
375 | ||||
376 | pcb0 = lwp_getpcb(&lwp0); | |||
377 | pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ | |||
378 | ||||
379 | lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; | |||
380 | 372 | |||
381 | /* | 373 | /* | |
382 | * Set up interrupt handling and I/O addresses. | 374 | * Set up interrupt handling and I/O addresses. | |
383 | */ | 375 | */ | |
384 | pizazz_init(); | 376 | pizazz_init(); | |
385 | } | 377 | } | |
386 | 378 | |||
387 | 379 | |||
388 | 380 | |||
389 | /* | 381 | /* | |
390 | * cpu_startup: allocate memory for variable-sized tables, | 382 | * cpu_startup: allocate memory for variable-sized tables, | |
391 | * initialize CPU, and do autoconfiguration. | 383 | * initialize CPU, and do autoconfiguration. | |
392 | */ | 384 | */ |
--- src/sys/arch/newsmips/stand/boot/Makefile 2009/04/15 17:15:13 1.20
+++ src/sys/arch/newsmips/stand/boot/Makefile 2009/12/16 23:19:07 1.21
@@ -1,40 +1,41 @@ | @@ -1,40 +1,41 @@ | |||
1 | # $NetBSD: Makefile,v 1.20 2009/04/15 17:15:13 tsutsui Exp $ | 1 | # $NetBSD: Makefile,v 1.21 2009/12/16 23:19:07 matt Exp $ | |
2 | 2 | |||
3 | S!= cd ${.CURDIR}/../../../..; pwd | 3 | S!= cd ${.CURDIR}/../../../..; pwd | |
4 | 4 | |||
5 | PROG= boot | 5 | PROG= boot | |
6 | SRCS= locore.S boot.c bootinfo.c devopen.c net.c netif_news.c | 6 | SRCS= locore.S boot.c bootinfo.c devopen.c net.c netif_news.c | |
7 | NOMAN= # defined | 7 | NOMAN= # defined | |
8 | STRIPFLAG= | 8 | STRIPFLAG= | |
9 | BINMODE= 444 | 9 | BINMODE= 444 | |
10 | WARNS?= 1 | 10 | WARNS?= 1 | |
11 | 11 | |||
12 | .include <bsd.own.mk> | 12 | .include <bsd.own.mk> | |
13 | 13 | |||
14 | COMMON!= cd ${.CURDIR}/../common && ${PRINTOBJDIR} | 14 | COMMON!= cd ${.CURDIR}/../common && ${PRINTOBJDIR} | |
15 | 15 | |||
16 | CLEANFILES+= ${PROG}.elf ${PROG}.tmp | 16 | CLEANFILES+= ${PROG}.elf ${PROG}.tmp | |
17 | 17 | |||
18 | LINKFLAGS= -x -N -Ttext a0700000 -e _start | 18 | LINKFLAGS= -x -N -Ttext a0700000 -e _start | |
19 | LINKFLAGS+= -T ${S}/arch/mips/conf/stand.ldscript | 19 | LINKFLAGS+= -T ${S}/arch/mips/conf/stand.ldscript | |
20 | CFLAGS= -Os -ffreestanding -mmemcpy -mno-abicalls -msoft-float -G 0 | 20 | CFLAGS= -Os -ffreestanding -mmemcpy -mno-abicalls -msoft-float -G 0 | |
21 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith | 21 | CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith | |
22 | 22 | |||
23 | CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK | 23 | CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK | |
24 | CPPFLAGS+= -DSUN_BOOTPARAMS | 24 | CPPFLAGS+= -DSUN_BOOTPARAMS | |
25 | CPPFLAGS+= -D_STANDALONE #-DBOOT_DEBUG | 25 | CPPFLAGS+= -D_STANDALONE #-DBOOT_DEBUG | |
26 | CPPFLAGS+= -I${.CURDIR} -I. -I${S} | 26 | CPPFLAGS+= -I${.CURDIR} -I. -I${S} | |
27 | CPPFLAGS+= -D__daddr_t=int32_t | 27 | CPPFLAGS+= -D__daddr_t=int32_t | |
28 | CPPFLAGS+= -DMIPS_KSEG1_START=0xa0000000 | |||
28 | 29 | |||
29 | AFLAGS= -D_LOCORE -mno-abicalls | 30 | AFLAGS= -D_LOCORE -mno-abicalls | |
30 | 31 | |||
31 | LIBS = ${COMMON}/romcalls.o | 32 | LIBS = ${COMMON}/romcalls.o | |
32 | LIBS+= ${COMMON}/lib/sa/libsa.a | 33 | LIBS+= ${COMMON}/lib/sa/libsa.a | |
33 | LIBS+= ${COMMON}/lib/z/libz.a | 34 | LIBS+= ${COMMON}/lib/z/libz.a | |
34 | LIBS+= ${COMMON}/lib/kern/libkern.a | 35 | LIBS+= ${COMMON}/lib/kern/libkern.a | |
35 | 36 | |||
36 | ${PROG}: ${OBJS} | 37 | ${PROG}: ${OBJS} | |
37 | ${_MKTARGET_LINK} | 38 | ${_MKTARGET_LINK} | |
38 | ${LD} ${LINKFLAGS} -o ${PROG}.elf ${OBJS} ${LIBS} | 39 | ${LD} ${LINKFLAGS} -o ${PROG}.elf ${OBJS} ${LIBS} | |
39 | -${SIZE} ${PROG}.elf | 40 | -${SIZE} ${PROG}.elf | |
40 | ${OBJCOPY} -O binary ${PROG}.elf ${PROG} | 41 | ${OBJCOPY} -O binary ${PROG}.elf ${PROG} |
--- src/sys/arch/sgimips/sgimips/machdep.c 2009/12/14 00:46:14 1.131
+++ src/sys/arch/sgimips/sgimips/machdep.c 2009/12/16 23:19:07 1.132
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: machdep.c,v 1.131 2009/12/14 00:46:14 matt Exp $ */ | 1 | /* $NetBSD: machdep.c,v 1.132 2009/12/16 23:19:07 matt Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2000 Soren S. Jorvang | 4 | * Copyright (c) 2000 Soren S. Jorvang | |
5 | * Copyright (c) 2001, 2002, 2003 Rafal K. Boni | 5 | * Copyright (c) 2001, 2002, 2003 Rafal K. Boni | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.131 2009/12/14 00:46:14 matt Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.132 2009/12/16 23:19:07 matt Exp $"); | |
38 | 38 | |||
39 | #include "opt_ddb.h" | 39 | #include "opt_ddb.h" | |
40 | #include "opt_kgdb.h" | 40 | #include "opt_kgdb.h" | |
41 | #include "opt_execfmt.h" | 41 | #include "opt_execfmt.h" | |
42 | #include "opt_cputype.h" | 42 | #include "opt_cputype.h" | |
43 | #include "opt_mips_cache.h" | 43 | #include "opt_mips_cache.h" | |
44 | #include "opt_modular.h" | 44 | #include "opt_modular.h" | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/kernel.h> | 48 | #include <sys/kernel.h> | |
49 | #include <sys/proc.h> | 49 | #include <sys/proc.h> | |
50 | #include <sys/buf.h> | 50 | #include <sys/buf.h> | |
@@ -273,30 +273,29 @@ static const char *bootinfo_msg = NULL; | @@ -273,30 +273,29 @@ static const char *bootinfo_msg = NULL; | |||
273 | #define ARCS_VECTOR MIPS_PHYS_TO_KSEG0(0x00001000) | 273 | #define ARCS_VECTOR MIPS_PHYS_TO_KSEG0(0x00001000) | |
274 | 274 | |||
275 | /* | 275 | /* | |
276 | * Do all the stuff that locore normally does before calling main(). | 276 | * Do all the stuff that locore normally does before calling main(). | |
277 | * Process arguments passed to us by the ARCS firmware. | 277 | * Process arguments passed to us by the ARCS firmware. | |
278 | */ | 278 | */ | |
279 | void | 279 | void | |
280 | mach_init(int argc, char *argv[], uintptr_t magic, void *bip) | 280 | mach_init(int argc, char *argv[], uintptr_t magic, void *bip) | |
281 | { | 281 | { | |
282 | paddr_t first, last; | 282 | paddr_t first, last; | |
283 | int firstpfn, lastpfn; | 283 | int firstpfn, lastpfn; | |
284 | vsize_t size; | 284 | vsize_t size; | |
285 | struct arcbios_mem *mem; | 285 | struct arcbios_mem *mem; | |
286 | struct pcb *pcb0; | |||
287 | const char *cpufreq, *osload; | 286 | const char *cpufreq, *osload; | |
288 | char *bootpath = NULL; | 287 | char *bootpath = NULL; | |
289 | vaddr_t kernend, v; | 288 | vaddr_t kernend; | |
290 | int kernstartpfn, kernendpfn; | 289 | int kernstartpfn, kernendpfn; | |
291 | int i, rv; | 290 | int i, rv; | |
292 | #if NKSYMS > 0 || defined(DDB) || defined(MODULAR) | 291 | #if NKSYMS > 0 || defined(DDB) || defined(MODULAR) | |
293 | int nsym = 0; | 292 | int nsym = 0; | |
294 | char *ssym = NULL; | 293 | char *ssym = NULL; | |
295 | char *esym = NULL; | 294 | char *esym = NULL; | |
296 | struct btinfo_symtab *bi_syms; | 295 | struct btinfo_symtab *bi_syms; | |
297 | #endif | 296 | #endif | |
298 | 297 | |||
299 | /* | 298 | /* | |
300 | * Initialize firmware. This will set up the bootstrap console. | 299 | * Initialize firmware. This will set up the bootstrap console. | |
301 | * At this point we do not yet know the machine type, so we | 300 | * At this point we do not yet know the machine type, so we | |
302 | * try to init real arcbios, and if that fails (return value 1), | 301 | * try to init real arcbios, and if that fails (return value 1), |