From a12dedc3eaa2f3f331537c4bcf3e54224a366db7 Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 20 Apr 1999 21:11:59 +0000 Subject: [PATCH] - Revert previous change to XentIF(), now that we're going to enter the debugger differently. - Pull in debugger glue if DDB is configured. And one unrelated change, while I was here: Don't create a fake trapframe for main(); it hasn't been used by main() for quite some time, and panic if main() returns, because that's not supposed to happen now. --- sys/arch/alpha/alpha/locore.s | 50 ++++++++++++----------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/sys/arch/alpha/alpha/locore.s b/sys/arch/alpha/alpha/locore.s index b74261aedef1..eb1a9fcaa299 100644 --- a/sys/arch/alpha/alpha/locore.s +++ b/sys/arch/alpha/alpha/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.61 1999/04/19 23:24:14 thorpej Exp $ */ +/* $NetBSD: locore.s,v 1.62 1999/04/20 21:11:59 thorpej Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -76,7 +76,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.61 1999/04/19 23:24:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.62 1999/04/20 21:11:59 thorpej Exp $"); #ifndef EVCNT_COUNTERS #include @@ -219,19 +219,12 @@ Lstart1: LDGP(pv) call_pal PAL_imb /* - * Construct a fake trap frame, so execve() can work normally. - * Note that setregs() is responsible for setting its contents - * to 'reasonable' values. + * All ready to go! Call main()! */ - lda sp,-(FRAME_SIZE * 8)(sp) /* space for struct trapframe */ - mov sp, a0 /* main()'s arg is frame ptr */ - CALL(main) /* go to main()! */ + CALL(main) - /* - * Call exception_return, to simulate return from (fake) - * exception to user-land, running process 1, init! - */ - jmp zero, exception_return /* "And that's all she wrote." */ + /* This should never happen. */ + PANIC("main() returned",Lmain_returned_pmsg) END(locorestart) /**************************************************************************/ @@ -281,6 +274,17 @@ Lstart1: LDGP(pv) /**************************************************************************/ +/**************************************************************************/ + +#if defined(DDB) +/* + * Pull in debugger glue. + */ +#include +#endif /* DDB */ + +/**************************************************************************/ + /**************************************************************************/ .data @@ -515,26 +519,6 @@ LEAF(exception_restore_regs, 0) /* a0, a1, & a2 already set up */ ldiq a3, ALPHA_KENTRY_IF mov sp, a4 ; .loc 1 __LINE__ -#if defined(DDB) - /* - * Kernel-mode BUGCHK and BPT traps enter the kernel debugger. - */ - ldq t0, (FRAME_PS*8)(sp) - and t0, ALPHA_PSL_USERMODE, t0 - bne t0, Lcalltrap /* usermode */ - - cmpeq a0, ALPHA_IF_CODE_BPT, t0 - bne t0, Lcalldbgr /* got BPT */ - - cmpeq a0, ALPHA_IF_CODE_BUGCHK, t0 - beq t0, Lcalltrap /* not BUGCHK */ -Lcalldbgr: - CALL(ddb_trap) - beq v0, Lcalltrap /* debugger didn't handle trap! */ - - jmp zero, exception_return /* debugger handled it, return */ -Lcalltrap: -#endif CALL(trap) jmp zero, exception_return END(XentIF)