|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
IRQs and ISRs for the SH4's CPU More...
Topics | |
| Context | |
| Thread execution state and accessors | |
| Control Flow | |
| Methods for managing control flow within an irq_handler. | |
| Exception type offsets | |
| Offsets within exception types | |
| Handlers | |
| API for managing IRQ handlers | |
| Mask | |
| Accessors and modifiers of the IMASK state. | |
| State | |
| Methods for querying active IRQ information. | |
Files | |
| file | irq.h |
| Interrupt and exception handling. | |
Macros | |
| #define | TIMER_IRQ EXC_TMU0_TUNI0 |
| The value of the timer IRQ. | |
| #define | IRQ_PRIO_MAX 15 |
| Minimum/maximum values for IRQ priorities. | |
| #define | IRQ_PRIO_MIN 1 |
| #define | IRQ_PRIO_MASKED 0 |
Functions | |
| void | irq_set_priority (irq_src_t src, unsigned int prio) |
| Set the priority of a given IRQ source. | |
| unsigned int | irq_get_priority (irq_src_t src) |
| Get the priority of a given IRQ source. | |
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.
| #define IRQ_PRIO_MASKED 0 |
| #define IRQ_PRIO_MAX 15 |
Minimum/maximum values for IRQ priorities.
A priority of zero means the interrupt is masked. The maximum priority that can be set is 15.
| #define IRQ_PRIO_MIN 1 |
| #define TIMER_IRQ EXC_TMU0_TUNI0 |
The value of the timer IRQ.
| enum irq_src_t |
| enum irq_t |
Interrupt exception codes.
SH-specific exception codes. Used to identify the source or type of an interrupt. Each exception code is of a certain "type" which dictates how the interrupt is generated and handled.
List of exception types:
| Type | Description |
|---|---|
RESET | Caused by system reset. Uncatchable and fatal. Automatically branch to address 0xA0000000. |
REEXEC | Restarts current instruction after interrupt processing. Context PC is the triggering instruction. |
POST | Continues with next instruciton after interrupt processing. Context PC is the next instruction. |
SOFT | Software-driven exceptions for triggering interrupts upon special events. |
UNUSED | Known to not be present and usable with the DC's SH4 configuration. |
List of exception codes:
| unsigned int irq_get_priority | ( | irq_src_t | src | ) |
Get the priority of a given IRQ source.
This function returns the priority of a given IRQ source.
| src | The interrupt source whose priority should be set |
| void irq_set_priority | ( | irq_src_t | src, |
| unsigned int | prio ) |
Set the priority of a given IRQ source.
This function can be used to set the priority of a given IRQ source.
| src | The interrupt source whose priority should be set |
| prio | The priority to set, in the range [0..15], 0 meaning the IRQs from that source are masked. |