From 0e3d6291e370c1b556d4d70d438cc743b0a5ab90 Mon Sep 17 00:00:00 2001 From: cgd Date: Sat, 7 Dec 1996 19:45:14 +0000 Subject: [PATCH] note what each of the argument registers in setregs() will be used for by crt0. Actually clear a1 and a2, because unless a shared loader (i.e. _not_ the kernel) set them when invoking crt0, they should be zero, and the kernel DEBUG code wouldn't necessarily have them be. Pass a pointer to the proc's ps_strings structure in a3. --- sys/arch/alpha/alpha/machdep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 68d3c1aeb261..e1170b224daf 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.61 1996/12/07 01:54:49 cgd Exp $ */ +/* $NetBSD: machdep.c,v 1.62 1996/12/07 19:45:14 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -1388,8 +1388,10 @@ setregs(p, pack, stack, retval) tfp->tf_regs[FRAME_PS] = ALPHA_PSL_USERSET; tfp->tf_regs[FRAME_PC] = pack->ep_entry & ~3; - tfp->tf_regs[FRAME_A0] = stack; - /* a1 and a2 already zeroed */ + tfp->tf_regs[FRAME_A0] = stack; /* a0 = sp */ + tfp->tf_regs[FRAME_A1] = 0; /* a1 = rtld cleanup */ + tfp->tf_regs[FRAME_A2] = 0; /* a2 = rtld object */ + tfp->tf_regs[FRAME_A3] = PS_STRINGS; /* a3 = ps_strings */ tfp->tf_regs[FRAME_T12] = tfp->tf_regs[FRAME_PC]; /* a.k.a. PV */ p->p_md.md_flags &= ~MDP_FPUSED;