KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Handlers

API for managing TRAPA handlers More...

Typedefs

typedef void(* trapa_handler) (trapa_t trap, irq_context_t *context, void *data)
 The type of a TRAPA handler.
 

Functions

int trapa_set_handler (trapa_t trap, trapa_handler hnd, void *data)
 Set or remove a handler for a trapa code.
 
trapa_handler trapa_get_handler (trapa_t trap, void **data)
 Get an existing TRAPA handler.
 

Detailed Description

API for managing TRAPA handlers

This API allows for the setting and retrieving of a handler associated with a particular TRAPA value.

Typedef Documentation

◆ trapa_handler

typedef void(* trapa_handler) (trapa_t trap, irq_context_t *context, void *data)

The type of a TRAPA handler.

Parameters
trapThe IRQ that caused the handler to be called.
contextThe CPU's context.
dataArbitrary userdata associated with the handler.

Function Documentation

◆ trapa_get_handler()

trapa_handler trapa_get_handler ( trapa_t trap,
void ** data )

Get an existing TRAPA handler.

Parameters
trapThe value passed to the trapa opcode.
dataA pointer to a void* which will be filled in with the handler's userdata, or NULL if not interested.
Returns
A pointer to the procedure to handle the TRAP code.
See also
trapa_set_handler()

◆ trapa_set_handler()

int trapa_set_handler ( trapa_t trap,
trapa_handler hnd,
void * data )

Set or remove a handler for a trapa code.

Parameters
trapThe value passed to the trapa opcode.
hndA pointer to the procedure to handle the trap.
dataA pointer that will be passed along to the callback.
Return values
0On success.
See also
trapa_get_handler()