summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2008-07-05 23:08:08 +0000
committerkettenis <kettenis@openbsd.org>2008-07-05 23:08:08 +0000
commitf0ec91c247bd8f43ff24ed1c0ae71f50455ff084 (patch)
treeadbd5597a97310bb0f207b9f2484c456d369dd90
parentAdd function to read %tba. (diff)
downloadwireguard-openbsd-f0ec91c247bd8f43ff24ed1c0ae71f50455ff084.tar.xz
wireguard-openbsd-f0ec91c247bd8f43ff24ed1c0ae71f50455ff084.zip
Copy OBP breakpoint vector from the PROM trap table into our own trap table.
This makes the kernel properly enter the prom upon halt on the v1280.
-rw-r--r--sys/arch/sparc64/sparc64/autoconf.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c
index dfdc7b5fa83..f48edc66011 100644
--- a/sys/arch/sparc64/sparc64/autoconf.c
+++ b/sys/arch/sparc64/sparc64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.93 2008/07/04 18:48:45 kettenis Exp $ */
+/* $OpenBSD: autoconf.c,v 1.94 2008/07/05 23:08:08 kettenis Exp $ */
/* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */
/*
@@ -260,6 +260,7 @@ bootstrap(nctx)
int nctx;
{
extern int end; /* End of kernel */
+ struct trapvec *romtba;
#if defined(SUN4US) || defined(SUN4V)
char buf[32];
#endif
@@ -371,6 +372,15 @@ bootstrap(nctx)
}
#endif
+ /*
+ * Copy over the OBP breakpoint trap vector; OpenFirmware 5.x
+ * needs it to be able to return to the ok prompt.
+ */
+ romtba = (struct trapvec *)sparc_rdpr(tba);
+ bcopy(&romtba[T_MON_BREAKPOINT], &trapbase[T_MON_BREAKPOINT],
+ sizeof(struct trapvec));
+ flush((void *)trapbase);
+
ncpus = get_ncpus();
pmap_bootstrap(KERNBASE, (u_long)&end, nctx, ncpus);
}