Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm26/arm26 Merge zero page into the start of locor...
details: https://anonhg.NetBSD.org/src/rev/e52358564468
branches: trunk
changeset: 500195:e52358564468
user: bjh21 <bjh21%NetBSD.org@localhost>
date: Thu Dec 07 21:48:58 2000 +0000
description:
Merge zero page into the start of locore. This allows us to just map the
start of the kernel text segment in at address 0 to get zero-page properly
mapped. This should save us one page, but that may need a bit of extra
shuffling before we can easily tell UVM about it.
diffstat:
sys/arch/arm26/arm26/locore.S | 70 ++++++++++++++++++++++++++-
sys/arch/arm26/arm26/start.c | 10 ++--
sys/arch/arm26/arm26/zeropage.S | 100 ----------------------------------------
3 files changed, 71 insertions(+), 109 deletions(-)
diffs (236 lines):
diff -r aa8027202e9b -r e52358564468 sys/arch/arm26/arm26/locore.S
--- a/sys/arch/arm26/arm26/locore.S Thu Dec 07 21:37:51 2000 +0000
+++ b/sys/arch/arm26/arm26/locore.S Thu Dec 07 21:48:58 2000 +0000
@@ -1,6 +1,6 @@
-/* $NetBSD: locore.S,v 1.4 2000/08/20 13:41:44 bjh21 Exp $ */
+/* $NetBSD: locore.S,v 1.5 2000/12/07 21:48:58 bjh21 Exp $ */
/*
- * Copyright (c) 1998, 2000 Ben Harris
+ * Copyright (c) 1998, 1999, 2000 Ben Harris
* Copyright (C) 1994-1997 Mark Brinicombe
* Copyright (C) 1994 Brini
* All rights reserved.
@@ -38,7 +38,7 @@
#include <machine/asm.h>
-RCSID("$NetBSD: locore.S,v 1.4 2000/08/20 13:41:44 bjh21 Exp $")
+RCSID("$NetBSD: locore.S,v 1.5 2000/12/07 21:48:58 bjh21 Exp $")
#include <sys/syscall.h>
#include <machine/armreg.h>
@@ -80,7 +80,69 @@
.global _C_LABEL(kernel_text)
_C_LABEL(kernel_text):
- b _C_LABEL(start) /* Just in case the linker loses it */
+
+/*
+ * Data to be mapped into zero page.
+ *
+ * Now, here we could do with the ability to change the assembler's
+ * idea of where we're assembling to without changing where it puts
+ * the output. Unfortunately, this kind of thing needs the connivance
+ * of the linker, which is asking a bit much. Thus...
+ *
+ * B and BL can be used normally within zero-page, but not between
+ * zero-page and the outside world.
+ *
+ * LDR can safely be used with a label within zero-page, but not to
+ * outside.
+ *
+ * Absolute references only work to outside. Relative references only
+ * work to inside.
+ *
+ *
+ * Instructions to copy to the bottom of zero page
+ * These are the entry point to the system exception routines
+ *
+ * They go:
+ * Reset
+ * Undefined instruction
+ * SWI
+ * Prefetch abort
+ * Data abort
+ * Address exception
+ * IRQ
+ * FIQ
+ */
+
+ .global _C_LABEL(page0), _C_LABEL(page0_end)
+_C_LABEL(page0):
+ ldr pc, Lreset_target
+ ldr pc, Lundefined_target
+ ldr pc, Lswi_target
+ ldr pc, Lprefetch_abort_target
+ ldr pc, Ldata_abort_target
+ ldr pc, Laddress_exception_target
+ ldr pc, Lirq_target
+Lfiqhandler:
+ .global _C_LABEL(fiqhandler)
+ .set _C_LABEL(fiqhandler), . - _C_LABEL(page0)
+ subs pc, lr, #4
+ .org Lfiqhandler + 0x100
+
+Lreset_target:
+ .word reset_entry
+Lundefined_target:
+ .word undefined_entry
+Lswi_target:
+ .word swi_entry
+Lprefetch_abort_target:
+ .word prefetch_abort_entry
+Ldata_abort_target:
+ .word data_abort_entry
+Laddress_exception_target:
+ .word address_exception_entry
+Lirq_target:
+ .word irq_entry
+_C_LABEL(page0_end):
/*
* Trap handlers
diff -r aa8027202e9b -r e52358564468 sys/arch/arm26/arm26/start.c
--- a/sys/arch/arm26/arm26/start.c Thu Dec 07 21:37:51 2000 +0000
+++ b/sys/arch/arm26/arm26/start.c Thu Dec 07 21:48:58 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: start.c,v 1.4 2000/09/21 23:22:51 bjh21 Exp $ */
+/* $NetBSD: start.c,v 1.5 2000/12/07 21:48:58 bjh21 Exp $ */
/*-
* Copyright (c) 1998, 2000 Ben Harris
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.4 2000/09/21 23:22:51 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.5 2000/12/07 21:48:58 bjh21 Exp $");
#include <sys/msgbuf.h>
#include <sys/user.h>
@@ -98,9 +98,11 @@
* 0x02090000 -- 0x02098000 == Kernel message buffer
* 0x02098000 -- freebase == Kernel image
* bss is cleared for us
+ * We re-map zero page to point at the start of the kernel image
+ * which is in locore.S.
*/
-#define ZP_PHYSADDR ((paddr_t)0x00080000)
+#define ZP_PHYSADDR ((paddr_t)0x00098000)
#define MSGBUF_PHYSADDR ((paddr_t)0x00090000)
/* We can't trust the BSS (at least not with my linker) */
@@ -205,8 +207,6 @@
VM_FREELIST_DEFAULT);
/* printf("Memory registered with UVM.\n"); */
- /* Set up CPU vectors in zero page */
- memcpy(MEMC_PHYS_BASE + ZP_PHYSADDR, page0, page0_end - page0);
/* Get the MEMC set up and map zero page */
pmap_bootstrap(bootconfig.npages, ZP_PHYSADDR);
diff -r aa8027202e9b -r e52358564468 sys/arch/arm26/arm26/zeropage.S
--- a/sys/arch/arm26/arm26/zeropage.S Thu Dec 07 21:37:51 2000 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/* $NetBSD: zeropage.S,v 1.1 2000/05/09 21:55:57 bjh21 Exp $ */
-/*-
- * Copyright (c) 1999 Ben Harris
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/* This file is part of NetBSD/arm26 -- a port of NetBSD to ARM2/3 machines. */
-/*
- * Data to be copied to zero page at runtime.
- */
-
-#include <machine/asm.h>
-
-RCSID("$NetBSD: zeropage.S,v 1.1 2000/05/09 21:55:57 bjh21 Exp $")
-
-/*
- * Now, here we could do with the ability to change the assembler's
- * idea of where we're assembling to without changing where it puts
- * the output. Unfortunately, this kind of thing needs the connivance
- * of the linker, which is asking a bit much. Thus...
- *
- * B and BL can be used normally within zero-page, but not between
- * zero-page and the outside world.
- *
- * LDR can safely be used with a label within zero-page, but not to
- * outside.
- *
- * Absolute references only work to outside. Relative references only
- * work to inside.
- */
-
- .text
- .align 0
-
-/*
- * Instructions to copy to the bottom of zero page
- * These are the entry point to the system exception routines
- *
- * They go:
- * Reset
- * Undefined instruction
- * SWI
- * Prefetch abort
- * Data abort
- * Address exception
- * IRQ
- * FIQ
- */
-
- .global _C_LABEL(page0), _C_LABEL(page0_end)
-_C_LABEL(page0):
- ldr pc, Lreset_target
- ldr pc, Lundefined_target
- ldr pc, Lswi_target
- ldr pc, Lprefetch_abort_target
- ldr pc, Ldata_abort_target
- ldr pc, Laddress_exception_target
- ldr pc, Lirq_target
-Lfiqhandler:
- .global _C_LABEL(fiqhandler)
- .set _C_LABEL(fiqhandler), . - _C_LABEL(page0)
- subs pc, lr, #4
- .org Lfiqhandler + 0x100
-
-Lreset_target:
- .word reset_entry
-Lundefined_target:
- .word undefined_entry
-Lswi_target:
- .word swi_entry
-Lprefetch_abort_target:
- .word prefetch_abort_entry
-Ldata_abort_target:
- .word data_abort_entry
-Laddress_exception_target:
- .word address_exception_entry
-Lirq_target:
- .word irq_entry
-_C_LABEL(page0_end):
Home |
Main Index |
Thread Index |
Old Index