Nios® V Processor Software Developer Handbook

ID 743810
Date 10/06/2025
Public
Document Table of Contents

18.1.5.1. 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 hardware exception handler. The handler argument is a pointer to the hardware 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 hardware 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 hardware exception handler is removed.

Return

--