next up previous contents
Next: 2.21 fluke_thread_set_saved_state: restores exception Up: 2 Thread Previous: 2.19 fluke_thread_set_client: change the

2.20 fluke_thread_set_handlers: register the exception handling routines for a thread.

SYNOPSIS

void fluke_thread_set_handlers(fluke_thread_t *cur_thread, oskit_addr_t trap_handler, oskit_addr_t interrupt_handler, oskit_addr_t client_alert_handler, oskit_addr_t server_alert_handler);

DESCRIPTION

Provides exception handling routines for the various classes of exceptions a thread may handle by itself. Parameters specific the addresses of function to be called when an exception of the particular class occurs. The exact calling convention for the handlers is architecture specific.

trap_handler is the routine which is called on synchronous exceptions such as unresolved page faults or ``insanity'' conditions.

interrupt_handler is the routine which is called on asynchronous exceptions; i.e., those generated by fluke_thread_interrupt.

client_alert_handler and server_alert_handler are the routines called asynchronous ``alerts'' are generated from either the client or server side of a reliable IPC connection.

PARAMETERS

cur_thread
A pointer to the thread object representing the current thread, e.g. as returned by fluke_thread_self.
trap_handler
Virtual address of the trap handler routine to use.
interrupt_handler
Virtual address of the interrupt handler routine to use.
client_alert_handler
Virtual address of the client-side alert handler routine to use.
server_alert_handler
Virtual address of the server-side alert handler routine to use.

ERRORS

If any of the following errors is detected by the Fluke implementation, it causes the current thread to take a synchronous exception with one of the following codes. All of these have an implicit FLUKE_INSANITY_ prefix.
NOT_CURRENT_THREAD
Thread specified was not the current thread.

RELATED INFORMATION

fluke_thread_enable_exceptions, fluke_thread_disable_exceptions, fluke_thread_interrupt, fluke_ipc_side_alert



Utah Flux Research Group