DEBUG kernels fill the registers with garbage on process startup and

Linux program don't like that.  Explicitly zero out the registers for
DEBUG kernels.
This commit is contained in:
simonb 2001-09-30 02:36:42 +00:00
parent 0b8f86120f
commit 8aec0ac7d5
1 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.17 2001/05/30 11:37:25 mrg Exp $ */ /* $NetBSD: linux_machdep.c,v 1.18 2001/09/30 02:36:42 simonb Exp $ */
/*- /*-
* Copyright (c) 1998 The NetBSD Foundation, Inc. * Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -101,8 +101,18 @@ linux_setregs(p, epp, stack)
struct exec_package *epp; struct exec_package *epp;
u_long stack; u_long stack;
{ {
/* XXX XAX I think this is ok. not sure though. */ #ifdef DEBUG
struct trapframe *tfp = p->p_md.md_tf;
#endif
setregs(p, epp, stack); setregs(p, epp, stack);
#ifdef DEBUG
/*
* Linux has registers set to zero on entry; for DEBUG kernels
* the alpha setregs() fills registers with 0xbabefacedeadbeef.
*/
memset(tfp->tf_regs, 0, FRAME_SIZE * sizeof tfp->tf_regs[0]);
#endif
} }
void setup_linux_rt_sigframe(tf, sig, mask) void setup_linux_rt_sigframe(tf, sig, mask)