Nios® V Processor Software Developer Handbook

ID 743810
Date 4/01/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

15.1.1.34. alt_instruction_exception_register()

Prototype

void alt_instruction_exception_register (

alt_exception_result (*handler)

( alt_exception_cause cause,

alt_u32 exception_pc,

alt_u32 bad_addr ))

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

No.

Available from ISR

Yes.

Include

<sys/alt_exceptions.h>

Description

The HAL API function alt_instruction_exception_register() registers an instruction-related exception handler. The handler argument is a pointer to the instruction-related exception handler.

You can only use this API function if you have enabled the hal.enable_instruction_related_exceptions_api setting in the board support package (BSP).

Register the instruction-related exception handler as early as possible in function main(). This allows you to handle abnormal conditions during startup.

You can register an exception handler from the alt_main() function.

A call to alt_instruction_exception_register() replaces the previously registered exception handler, if any. If handler is set to null, the instruction-related exception handler is removed.

Return

--