From 70fe6c76a1cf8b7854e40bd37f60e1f949786e4f Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 2 Aug 1998 21:50:31 +0000 Subject: [PATCH] Pass ps_strings in r0 when execing processes. Use macros rather than absolute values in zero_page_read*() functions. --- sys/arch/arm32/arm32/machdep.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/sys/arch/arm32/arm32/machdep.c b/sys/arch/arm32/arm32/machdep.c index 56ffe92c8dce..30231a6a27b0 100644 --- a/sys/arch/arm32/arm32/machdep.c +++ b/sys/arch/arm32/arm32/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.41 1998/07/08 00:10:46 mark Exp $ */ +/* $NetBSD: machdep.c,v 1.42 1998/08/02 21:50:31 mark Exp $ */ /* * Copyright (c) 1994-1996 Mark Brinicombe. @@ -654,13 +654,23 @@ setregs(p, pack, stack) (u_int) tf, tf->tf_pc, tf->tf_usr_lr, tf->tf_usr_sp); #endif + tf->tf_r0 = (u_int)PS_STRINGS; + tf->tf_r1 = 0; + tf->tf_r2 = 0; + tf->tf_r3 = 0; + tf->tf_r4 = 0; + tf->tf_r5 = 0; + tf->tf_r6 = 0; + tf->tf_r7 = 0; + tf->tf_r8 = 0; + tf->tf_r9 = 0; + tf->tf_r10 = 0; tf->tf_r11 = 0; /* bottom of the fp chain */ - tf->tf_r12 = stack; /* needed by crt0.c */ - tf->tf_pc = pack->ep_entry; + tf->tf_r12 = stack; /* needed by old crt0.c */ + tf->tf_usr_sp = stack; tf->tf_usr_lr = pack->ep_entry; tf->tf_svc_lr = 0x77777777; /* Something we can see */ - tf->tf_usr_sp = stack; - tf->tf_r10 = 0xaa55aa55; /* Something we can see */ + tf->tf_pc = pack->ep_entry; tf->tf_spsr = PSR_USR32_MODE; p->p_addr->u_pcb.pcb_flags = 0; @@ -677,7 +687,8 @@ setregs(p, pack, stack) void zero_page_readonly() { - WriteWord(0xefc00000, L2_PTE((systempage.physical & PG_FRAME), AP_KR)); + WriteWord(PROCESS_PAGE_TBLS_BASE + 0, + L2_PTE((systempage.physical & PG_FRAME), AP_KR)); cpu_tlb_flushID_SE(0x00000000); } @@ -692,7 +703,8 @@ zero_page_readonly() void zero_page_readwrite() { - WriteWord(0xefc00000, L2_PTE((systempage.physical & PG_FRAME), AP_KRW)); + WriteWord(PROCESS_PAGE_TBLS_BASE + 0, + L2_PTE((systempage.physical & PG_FRAME), AP_KRW)); cpu_tlb_flushID_SE(0x00000000); }