| |||
| Home > ARMulator > Upcalls > Installing and removing upcalls | |||
Each upcall has its own installation and removal functions. These functions follow a standard format, as described below.
Each upcall in installed using a function of the form:
void *ARMul_Install<UpcallName>(ARMul_State *state, typename *fn,
void *handle)
where:
<UpcallName>is the name of the upcall. For example, the ExitUpcall() is
installed with ARMul_InstallExitHandler. The
upcalls are:
ExitUpcall()
ModeChangeUpcall()
TransChangeUpcall()
ConfigChangeUpcall()
InterruptUpcall()
ExceptionUpcall()
UnkRDIInfoUpcall().
stateis a pointer to the ARMulator state.
typenameis the type of the function, as defined by typedef in the upcall prototype.
fnis a pointer to the function to be installed.
handleis the handle to be passed to the corresponding Remove upcall function.
The function returns a void * handle to the upcall handler. This should be kept because it is required by the corresponding Remove upcall function.
Each upcall is removed using a function of the form:
int *ARMul_Remove<UpcallName>(ARMulState *state, void *node)
where:
<UpcallName>is the name of the upcall to be removed. For example,the ExitUpcall() is removed
with ARMul_RemoveExitHandler. See the description
of the Install upcall function for a list of upcall names.
stateis the state pointer.
nodeis the handle returned from the corresponding Install upcall function.
The remove upcall functions return:
TRUE if
the upcall is removed
FALSE if the upcall remove failed.