| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: machdep.c,v 1.232 2009/03/18 10:22:33 cegger Exp $ */ | | 1 | /* $NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui 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: |
| @@ -67,27 +67,27 @@ | | | @@ -67,27 +67,27 @@ |
67 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 67 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
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 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 | | 75 | * @(#)machdep.c 8.3 (Berkeley) 1/12/94 |
76 | * from: Utah Hdr: machdep.c 1.63 91/04/24 | | 76 | * from: Utah Hdr: machdep.c 1.63 91/04/24 |
77 | */ | | 77 | */ |
78 | | | 78 | |
79 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | | 79 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ |
80 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2009/03/18 10:22:33 cegger Exp $"); | | 80 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2009/07/21 14:26:48 tsutsui Exp $"); |
81 | | | 81 | |
82 | #include "fs_mfs.h" | | 82 | #include "fs_mfs.h" |
83 | #include "opt_ddb.h" | | 83 | #include "opt_ddb.h" |
84 | #include "opt_modular.h" | | 84 | #include "opt_modular.h" |
85 | | | 85 | |
86 | #include <sys/param.h> | | 86 | #include <sys/param.h> |
87 | #include <sys/systm.h> | | 87 | #include <sys/systm.h> |
88 | #include <sys/kernel.h> | | 88 | #include <sys/kernel.h> |
89 | #include <sys/buf.h> | | 89 | #include <sys/buf.h> |
90 | #include <sys/reboot.h> | | 90 | #include <sys/reboot.h> |
91 | #include <sys/user.h> | | 91 | #include <sys/user.h> |
92 | #include <sys/mount.h> | | 92 | #include <sys/mount.h> |
93 | #include <sys/kcore.h> | | 93 | #include <sys/kcore.h> |
| @@ -221,33 +221,33 @@ mach_init(int argc, char *argv[], int co | | | @@ -221,33 +221,33 @@ mach_init(int argc, char *argv[], int co |
221 | bootinfo_msg = "invalid bootinfo pointer (old bootblocks?)\n"; | | 221 | bootinfo_msg = "invalid bootinfo pointer (old bootblocks?)\n"; |
222 | | | 222 | |
223 | /* clear the BSS segment */ | | 223 | /* clear the BSS segment */ |
224 | #if NKSYMS || defined(DDB) || defined(MODULAR) | | 224 | #if NKSYMS || defined(DDB) || defined(MODULAR) |
225 | bi_syms = lookup_bootinfo(BTINFO_SYMTAB); | | 225 | bi_syms = lookup_bootinfo(BTINFO_SYMTAB); |
226 | aout = (struct exec *)edata; | | 226 | aout = (struct exec *)edata; |
227 | | | 227 | |
228 | /* Was it a valid bootinfo symtab info? */ | | 228 | /* Was it a valid bootinfo symtab info? */ |
229 | if (bi_syms != NULL) { | | 229 | if (bi_syms != NULL) { |
230 | ssym = (void *)bi_syms->ssym; | | 230 | ssym = (void *)bi_syms->ssym; |
231 | esym = (void *)bi_syms->esym; | | 231 | esym = (void *)bi_syms->esym; |
232 | kernend = (void *)mips_round_page(esym); | | 232 | kernend = (void *)mips_round_page(esym); |
233 | memset(edata, 0, end - edata); | | 233 | memset(edata, 0, end - edata); |
234 | } | | 234 | } else |
| | | 235 | #ifdef EXEC_AOUT |
235 | /* XXX: Backwards compatibility with old bootblocks - this should | | 236 | /* XXX: Backwards compatibility with old bootblocks - this should |
236 | * go soon... | | 237 | * go soon... |
237 | */ | | 238 | */ |
238 | #ifdef EXEC_AOUT | | | |
239 | /* Exec header and symbols? */ | | 239 | /* Exec header and symbols? */ |
240 | else if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) { | | 240 | if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) { |
241 | ssym = end; | | 241 | ssym = end; |
242 | i += (*(long *)(end + i + 4) + 3) & ~3; /* strings */ | | 242 | i += (*(long *)(end + i + 4) + 3) & ~3; /* strings */ |
243 | esym = end + i + 4; | | 243 | esym = end + i + 4; |
244 | kernend = (void *)mips_round_page(esym); | | 244 | kernend = (void *)mips_round_page(esym); |
245 | memset(edata, 0, end - edata); | | 245 | memset(edata, 0, end - edata); |
246 | } else | | 246 | } else |
247 | #endif | | 247 | #endif |
248 | #endif | | 248 | #endif |
249 | { | | 249 | { |
250 | kernend = (void *)mips_round_page(end); | | 250 | kernend = (void *)mips_round_page(end); |
251 | memset(edata, 0, kernend - edata); | | 251 | memset(edata, 0, kernend - edata); |
252 | } | | 252 | } |
253 | | | 253 | |