summaryrefslogtreecommitdiff
path: root/libhurd-mm/exceptions.c
diff options
context:
space:
mode:
authorneal <neal>2007-11-27 12:37:05 +0000
committerneal <neal>2007-11-27 12:37:05 +0000
commitc744a56f1aad390e22ff14b21eb8d1a259ac861c (patch)
treedf1d2ac7fc5a1b24abdba7f52a0f7fb80925f1bf /libhurd-mm/exceptions.c
parent14f2c474ec9f32f493f6ec0b7e5bb2ca03ba8e0f (diff)
2007-11-27 Neal H. Walfield <neal@gnu.org>
* exceptions.c (exception_handler_init): Use _L4_exchange_registers rather than l4_start_sp_ip to be able to detect errors.
Diffstat (limited to 'libhurd-mm/exceptions.c')
-rw-r--r--libhurd-mm/exceptions.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libhurd-mm/exceptions.c b/libhurd-mm/exceptions.c
index 94f46c2..bb74ccf 100644
--- a/libhurd-mm/exceptions.c
+++ b/libhurd-mm/exceptions.c
@@ -131,6 +131,21 @@ exception_handler_init (void)
downward. */
char *sp = (char *) stack + STACK_SIZE;
+ debug (5, "Starting exception thread");
+
l4_thread_id_t tid = hurd_exception_thread (l4_myself ());
- l4_start_sp_ip (tid, (l4_word_t) sp, (l4_word_t) &exception_handler_loop);
+ l4_word_t control = _L4_XCHG_REGS_SET_HALT | _L4_XCHG_REGS_SET_SP
+ | _L4_XCHG_REGS_SET_IP | _L4_XCHG_REGS_CANCEL_IPC;
+ l4_word_t dummy = 0;
+ l4_word_t ip = exception_handler_loop;
+ _L4_exchange_registers (&tid, &control, &sp, &ip,
+ &dummy, &dummy, &dummy);
+ if (tid == l4_nilthread)
+ {
+ int err = l4_error_code ();
+ panic ("Error starting exception thread %x.%x: %s (%d)",
+ l4_thread_no (hurd_exception_thread (l4_myself ())),
+ l4_version (hurd_exception_thread (l4_myself ())),
+ l4_strerror (err), err);
+ }
}