summaryrefslogtreecommitdiff
path: root/hurd/thread.h
diff options
context:
space:
mode:
authorneal <neal>2007-12-05 18:54:39 +0000
committerneal <neal>2007-12-05 18:54:39 +0000
commitdb50253f3f5534019e1da7b72a03828a6b4c17d2 (patch)
tree47bcc1af76f2cb5a17f9c3ceea2c6c1643bb58c4 /hurd/thread.h
parent1a88abf3c2d9757b7b61128475d0a10bb1d07018 (diff)
hurd/
2007-12-05 Neal H. Walfield <neal@gnu.org> * thread.h (struct exception_page): Add fields exception_stack and exception_stack_bottom. (hurd_exception_handler_t): Don't define. * exceptions.h (fault): Add argument, sp. (exception_handler): Remove declaration. (exception_handler_activated): New declaration. (exception_handler_normal): Likewise. libhurd-mm/ 2007-12-05 Neal H. Walfield <neal@gnu.org> * exceptions.c: Include <hurd/slab.h> and "as.h". (exception_frame_slab): New local variable. (exception_frame_slab_alloc): New function. (exception_frame_slab_dealloc): Likewise. (exception_frame_alloc): Likewise. (exception_handler): Rename from this... (exception_handler_activated): ... to this. Update callers. Only handle the fault if the fault corresponds to the page the stack pointer references at the time of the fault or the next stack page. (exception_handler_normal): New function. (exception_handler_init): Initialize exception_frame_slab. * ia32-exception-entry.S (EXCEPTION_STACK): New macro. (SAVED_EDX): Likewise. (EF_SAVED_EAX): Likewise. (EF_SAVED_ECX): Likewise. (EF_SAVED_EDX): Likewise. (EF_SAVED_FLAGS): Likewise. (EF_SAVED_IP): Likewise. (EF_STACK_START): Likewise. (EF_NEXT): Likewise. (exception_handler_entry): After calling exception_handler_activated, check if the return result is non-zero. If so, call exception_handler_normal. viengoos/ 2007-12-05 Neal H. Walfield <neal@gnu.org> * server.c (server_loop): When marshalling the fault, return the current stack pointer, consistent with the updated interface.
Diffstat (limited to 'hurd/thread.h')
-rw-r--r--hurd/thread.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/hurd/thread.h b/hurd/thread.h
index 709e9ec..8290b6e 100644
--- a/hurd/thread.h
+++ b/hurd/thread.h
@@ -33,6 +33,18 @@ enum
RM_thread_exregs = 600,
};
+struct exception_frame
+{
+#if i386
+ l4_word_t regs[5];
+#else
+# error Not ported to this architecture!
+#endif
+ struct exception_frame *next;
+ struct exception_frame *prev;
+ l4_msg_t exception;
+};
+
struct exception_page
{
union
@@ -59,6 +71,11 @@ struct exception_page
/* The state of the thread (as returned by _L4_exchange_regs) */
l4_word_t saved_thread_state;
+ /* Top of the exception frame stack. */
+ struct exception_frame *exception_stack;
+ /* Bottom of the exception frame stack. */
+ struct exception_frame *exception_stack_bottom;
+
l4_word_t exception_handler_sp;
l4_word_t exception_handler_ip;
l4_word_t exception_handler_end;
@@ -109,8 +126,6 @@ enum
HURD_EXREGS_ABORT_IPC = HURD_EXREGS_ABORT_SEND | _L4_XCHG_REGS_CANCEL_RECV,
};
-typedef void (*hurd_exception_handler_t) (struct exception_page *);
-
#define RPC_STUB_PREFIX rm
#define RPC_ID_PREFIX RM
#undef RPC_TARGET_NEED_ARG