Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

14.1.37. 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).

For more information, refer to “Settings Managed by the Software Build Tools” in the "Nios II Software Build Tools Reference" chapter.

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.

For more information about usage, refer to the "Exception Handling" section.

Return

--