IRQs and ISRs for the SH4's CPU
More...
|
| file | irq.h |
| | Interrupt and exception handling.
|
| |
|
Convenience macros for accessing context registers
|
| #define | CONTEXT_PC(c) |
| | Fetch the program counter from an irq_context_t.
|
| |
| #define | CONTEXT_FP(c) |
| | Fetch the frame pointer from an irq_context_t.
|
| |
| #define | CONTEXT_SP(c) |
| | Fetch the stack pointer from an irq_context_t.
|
| |
| #define | CONTEXT_RET(c) |
| | Fetch the return value from an irq_context_t.
|
| |
IRQs and ISRs for the SH4's CPU
This is an API for managing interrupts, their masks, and their handler routines along with thread context information.
- Warning
- This is a low-level, internal kernel API. Many of these interrupts are utilized by various KOS drivers and have higher-level APIs for hooking into them. Care must be taken to not interfere with the IRQ handling which is being done by in-use KOS drivers.
- Note
- The naming convention used by this API differs from that of the actual SH4 manual for historical reasons (it wasn't platform-specific). The SH4 manual refers to the most general type of CPU events which result in a SW callback as "exceptions," with "interrupts" and "general exceptions" being subtypes of exceptions. This API uses the term "interrupt" and "exception" interchangeably, except where it is explicitly noted that "SH4 interrupts" or "SH4 general exceptions" are being referred to, more specifically.
◆ CONTEXT_FP
Value:
Fetch the frame pointer from an irq_context_t.
- Parameters
-
| c | The context to read from. |
- Returns
- The frame pointer value.
◆ CONTEXT_PC
Value:
Fetch the program counter from an irq_context_t.
- Parameters
-
| c | The context to read from. |
- Returns
- The program counter value.
Referenced by catchnull(), and on_break().
◆ CONTEXT_RET
Value:
Fetch the return value from an irq_context_t.
- Parameters
-
| c | The context to read from. |
- Returns
- The return value.
◆ CONTEXT_SP
Value:
Fetch the stack pointer from an irq_context_t.
- Parameters
-
| c | The context to read from. |
- Returns
- The stack pointer value.