next up previous contents
Next: 2.12 fluke_thread_get_server: retrieve the Up: 2 Thread Previous: 2.10 fluke_thread_get_handlers: return the

2.11 fluke_thread_get_saved_state: retrieve the exception state of a thread

SYNOPSIS

void fluke_thread_get_saved_state(fluke_thread_t *cur_thread, struct fluke_thread_saved_state *saved_state);

DESCRIPTION

Returns an architecture-specific subset of the state of the current thread. In particular, it returns only the CPU state that the system needed to save prior to changing it to invoke the exception handler. For example, on most architectures, this would include the instruction and stack pointer values at the time of the fault. It is the responsibility of the exception handler to save all other volatile state (e.g., caller-save registers).

This call is only necessary if the exception handler wants to change the value of some element of the saved state. Otherwise, the saved values will be automatically restored on a fluke_thread_return_from_exception.

PARAMETERS

cur_thread
A pointer to the thread object representing the current thread, e.g. as returned by fluke_thread_self.
saved_state
A pointer to the architecture-specific saved state structure.

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_set_handlers, fluke_thread_set_saved_state, fluke_thread_return_from_exception



Utah Flux Research Group