Xilinx MicroBlaze Reference Manual page 157

Embedded development kit edk 14.7
Hide thumbs Also See for MicroBlaze:
Table of Contents

Advertisement

In the current MicroBlaze system, there are dummy routines for interrupt and user exception
handling, which you can change. In order to override these routines and link your own interrupt and
exception handlers, you must define the handler code with specific attributes.
The interrupt handler code must be defined with attribute interrupt_handler to ensure that
the compiler will generate code to save and restore used registers and emit an rtid instruction to
return from the handler:
The user exception handler code must either be defined with either attribute svc_handler or
attribute svc_table_handler:
The first attribute ensures that the compiler will emit an indirect call to the handler with a brki
rD,0x8 instruction, and emit an rtbd instruction to return from the handler. This means that when
the MMU is enabled the handler function is executed in privileged mode.
The second attribute is declared with a Service ID. In this case the compiler will emit code to store
this ID in register R18 followed by an indirect call to _exception_handler using a brki
rD,0x8 instruction, and emit an rtbd instruction to return from the handler. It is necessary to
override the _exception_handler function to call the appropriate handler based on the ID
provided in R18.
For more details about the use and syntax of the handler attributes, please refer to the GNU Compiler
Tools chapter in the Embedded System Tools Reference Manual.
When software breakpoints are used in the Xilinx Microprocessor Debug (XMD) tool or the
Software Development Kit (SDK) tool, the Break (HW/SW) address location is reserved for
handling the software breakpoint.
MicroBlaze Processor Reference Guide
UG081 (v14.7)
void function_name() __attribute__((interrupt_handler));
void function_name() __attribute__((svc_handler));
void function_name() __attribute__((svc_table_handler (ID)));
www.xilinx.com
Interrupt and Exception Handling
Send Feedback
157

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MicroBlaze and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents