Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/cats/cats Make this compile with VERBOSE_ARM_INIT.
details: https://anonhg.NetBSD.org/src/rev/ce083acd4661
branches: trunk
changeset: 773571:ce083acd4661
user: matt <matt%NetBSD.org@localhost>
date: Mon Feb 06 17:51:47 2012 +0000
description:
Make this compile with VERBOSE_ARM_INIT.
If the AOUT magic is not ZMAGIC, assume kernel is ELF.
diffstat:
sys/arch/cats/cats/cats_machdep.c | 62 ++++++++++++++++++--------------------
1 files changed, 29 insertions(+), 33 deletions(-)
diffs (106 lines):
diff -r 3544d0963928 -r ce083acd4661 sys/arch/cats/cats/cats_machdep.c
--- a/sys/arch/cats/cats/cats_machdep.c Mon Feb 06 17:51:05 2012 +0000
+++ b/sys/arch/cats/cats/cats_machdep.c Mon Feb 06 17:51:47 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cats_machdep.c,v 1.71 2011/07/01 20:35:31 dyoung Exp $ */
+/* $NetBSD: cats_machdep.c,v 1.72 2012/02/06 17:51:47 matt Exp $ */
/*
* Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.71 2011/07/01 20:35:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.72 2012/02/06 17:51:47 matt Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@@ -385,7 +385,8 @@
if (ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_EBSA
&& ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_CATS)
- panic("Incompatible magic number passed in boot args");
+ panic("Incompatible magic number %#x passed in boot args",
+ ebsabootinfo.bt_magic);
#ifdef VERBOSE_INIT_ARM
/* output the incoming bootinfo */
@@ -581,8 +582,11 @@
#endif
/* Now we fill in the L2 pagetable for the kernel static code/data */
-#ifdef ABLEELF
- {
+ struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
+ if (N_GETMAGIC(kernexec[0]) != ZMAGIC) {
+ /*
+ * If it's not a.out, assume ELF.
+ */
extern char etext[], _end[];
size_t textsize = (uintptr_t) etext - KERNEL_BASE;
size_t totalsize = (uintptr_t) _end - KERNEL_BASE;
@@ -598,35 +602,27 @@
(void) pmap_map_chunk(l1pagetable, KERNEL_BASE + logical,
physical_start + logical, totalsize - textsize,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- }
-#else
- {
- struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
- if (N_GETMAGIC(kernexec[0]) != ZMAGIC)
- panic("Illegal kernel format");
- else {
- extern int end;
- u_int logical;
+ } else {
+ extern int end;
+ u_int logical;
- logical = pmap_map_chunk(l1pagetable, KERNEL_TEXT_BASE,
- physical_start, kernexec->a_text,
- VM_PROT_READ, PTE_CACHE);
- logical += pmap_map_chunk(l1pagetable,
- KERNEL_TEXT_BASE + logical,
- physical_start + logical, kernexec->a_data,
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- logical += pmap_map_chunk(l1pagetable,
- KERNEL_TEXT_BASE + logical,
- physical_start + logical, kernexec->a_bss,
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- logical += pmap_map_chunk(l1pagetable,
- KERNEL_TEXT_BASE + logical,
- physical_start + logical, kernexec->a_syms + sizeof(int)
- + *(u_int *)((int)&end + kernexec->a_syms + sizeof(int)),
- VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
- }
+ logical = pmap_map_chunk(l1pagetable, KERNEL_TEXT_BASE,
+ physical_start, kernexec->a_text,
+ VM_PROT_READ, PTE_CACHE);
+ logical += pmap_map_chunk(l1pagetable,
+ KERNEL_TEXT_BASE + logical,
+ physical_start + logical, kernexec->a_data,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+ logical += pmap_map_chunk(l1pagetable,
+ KERNEL_TEXT_BASE + logical,
+ physical_start + logical, kernexec->a_bss,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+ logical += pmap_map_chunk(l1pagetable,
+ KERNEL_TEXT_BASE + logical,
+ physical_start + logical, kernexec->a_syms + sizeof(int)
+ + *(u_int *)((int)&end + kernexec->a_syms + sizeof(int)),
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
}
-#endif
/*
* PATCH PATCH ...
@@ -695,7 +691,7 @@
*/
#ifdef VERBOSE_INIT_ARM
/* checking sttb address */
- printf("cpu_setttb address = %p\n", cpu_setttb);
+ printf("cpu_setttb address = %p\n", cpufuncs.cf_setttb);
printf("kernel_l1pt=0x%08x old = 0x%08x, phys = 0x%08x\n",
((uint*)kernel_l1pt.pv_va)[0xf00],
Home |
Main Index |
Thread Index |
Old Index