summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-09-24 13:43:26 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-09-24 13:43:26 +0000
commit3692b64d575f468f6f2d796a62aa2c9cb7924a8e (patch)
tree2a1202fd2dfd200d7ded83caf908abe1ffa5b0c6 /sys/arch
parentf07f96ab40c87fd2ac7c668c8a9e0d9fc8b46f71 (diff)
If the value of r0 upon entering the kernel is zero, interpret this as the
address of the end of the symbol table. This will make it possible to get rid of the code in the bootloader that patches up the kernel with the updated esym value. ok tom@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/arm/locore.S4
-rw-r--r--sys/arch/arm/include/machdep.h4
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c9
-rw-r--r--sys/arch/armv7/armv7/armv7_start.S5
4 files changed, 13 insertions, 9 deletions
diff --git a/sys/arch/arm/arm/locore.S b/sys/arch/arm/arm/locore.S
index a1532f63d6d..a142476f2ed 100644
--- a/sys/arch/arm/arm/locore.S
+++ b/sys/arch/arm/arm/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.11 2016/09/21 11:33:05 kettenis Exp $ */
+/* $OpenBSD: locore.S,v 1.12 2016/09/24 13:43:25 kettenis Exp $ */
/* $NetBSD: locore.S,v 1.14 2003/04/20 16:21:40 thorpej Exp $ */
/*
@@ -56,6 +56,7 @@ ENTRY_NP(kernel_text)
ASENTRY_NP(start)
mov r5, r1
mov r6, r2
+ mov r7, r3
adr r1, .Lstart
ldmia r1, {r1, r2, r8, sp} /* Set initial stack and */
@@ -74,6 +75,7 @@ ASENTRY_NP(start)
mov fp, #0x00000000 /* trace back starts here */
mov r1, r5
mov r2, r6
+ mov r3, r7
bl _C_LABEL(initarm) /* Off we go */
/* init arm will return the new stack pointer. */
diff --git a/sys/arch/arm/include/machdep.h b/sys/arch/arm/include/machdep.h
index b7f035675ed..d5f06623e05 100644
--- a/sys/arch/arm/include/machdep.h
+++ b/sys/arch/arm/include/machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.h,v 1.4 2011/10/19 20:18:31 drahn Exp $ */
+/* $OpenBSD: machdep.h,v 1.5 2016/09/24 13:43:25 kettenis Exp $ */
/* $NetBSD: machdep.h,v 1.7 2002/02/21 02:52:21 thorpej Exp $ */
#ifndef _ARM_MACHDEP_H_
@@ -16,7 +16,7 @@ void dumpsys (void);
* note that we use void * as all the platforms have different ideas on what
* the structure is
*/
-u_int initarm (void *, void *, void *);
+u_int initarm (void *, void *, void *, paddr_t);
/* from arm/arm/intr.c */
void dosoftints (void);
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index afd7ca2e36d..e869c2c6f70 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.39 2016/09/01 09:05:37 kettenis Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.40 2016/09/24 13:43:25 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -376,13 +376,12 @@ copy_io_area_map(pd_entry_t *new_pd)
* Setting up page tables for the kernel.
*/
u_int
-initarm(void *arg0, void *arg1, void *arg2)
+initarm(void *arg0, void *arg1, void *arg2, paddr_t loadaddr)
{
int loop, loop1, i, physsegs = VM_PHYSSEG_MAX;
u_int l1pagetable;
pv_addr_t kernel_l1pt;
pv_addr_t fdt;
- paddr_t loadaddr;
struct fdt_reg reg;
paddr_t memstart;
psize_t memsize;
@@ -397,7 +396,9 @@ initarm(void *arg0, void *arg1, void *arg2)
int (*map_func_save)(void *, bus_addr_t, bus_size_t, int,
bus_space_handle_t *);
- loadaddr = (paddr_t)arg0;
+ if (arg0)
+ esym = (uint32_t)arg0;
+
board_id = (uint32_t)arg1;
/*
* u-boot has decided the top four bits are
diff --git a/sys/arch/armv7/armv7/armv7_start.S b/sys/arch/armv7/armv7/armv7_start.S
index 922a7aed2d1..4f96d770fee 100644
--- a/sys/arch/armv7/armv7/armv7_start.S
+++ b/sys/arch/armv7/armv7/armv7_start.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_start.S,v 1.9 2016/08/26 11:59:04 kettenis Exp $ */
+/* $OpenBSD: armv7_start.S,v 1.10 2016/09/24 13:43:25 kettenis Exp $ */
/* $NetBSD: lubbock_start.S,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
/*
@@ -161,9 +161,10 @@ _C_LABEL(bootstrap_start):
CPWAIT(r0)
/* Restore U-Boot arguments */
- mov r0, r9
+ mov r0, r6
mov r1, r7
mov r2, r8
+ mov r3, r9
/* Jump to kernel code in TRUE VA */
adr r6, Lstart