4.7.1. Exception handler

This event handler is called whenever the ARM processor takes an exception.

Syntax


typedef unsigned GenericCallbackFunc(void *handlevoid *data)

where:

handle

is the handle passed to ARMulif_InstallExceptionHandler.

data

must be cast to (ARMul_Event *),and contain:

((ARMul_Event *)data)->event

is the core event causing the exception (see Table 4.2).

((ARMul_Event *)data)->data1

is the address of the hardware vector for the exception.

((ARMul_Event *)data)->data2

is the instruction that caused the exception.

Usage

As an example, this can be used by an operating system model to intercept and simulate SWIs. If an installed handler returns nonzero, the ARM does not take the exception (the exception is ignored).

Note

If the processor is in Thumb state, the equivalent ARM instruction will be supplied.

Install the exception handler using:


int ARMulif_InstallExceptionHandler(RDI_ModuleDesc *mdesc,                                    GenericCallbackFunc *funcvoid *handle)

Remove the exception handler using:


int ARMulif_RemoveExceptionHandler(RDI_ModuleDesc *mdesc,                                   GenericCallbackFunc *funcvoid *handle)

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI0058D
Non-Confidential