KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
irq.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 arch/dreamcast/include/arch/irq.h
4 Copyright (C) 2000, 2001 Megan Potter
5 Copyright (C) 2024 Paul Cercueil
6 Copyright (C) 2024, 2025 Falco Girgis
7
8*/
9
10/** \file arch/irq.h
11 \brief Interrupt and exception handling.
12 \ingroup irqs
13
14 This file contains various definitions and declarations related to handling
15 interrupts and exceptions on the Dreamcast. This level deals with IRQs and
16 exceptions generated on the SH4, versus the asic layer which deals with
17 actually differentiating "external" interrupts.
18
19 \author Megan Potter
20 \author Paul Cercueil
21 \author Falco Girgis
22
23 \see dc/asic.h, arch/trap.h
24*/
25
26#ifndef __ARCH_IRQ_H
27#define __ARCH_IRQ_H
28
29#include <stdalign.h>
30#include <stdbool.h>
31#include <stdint.h>
32#include <kos/cdefs.h>
33__BEGIN_DECLS
34
35/** \defgroup irqs Interrupts
36 \brief IRQs and ISRs for the SH4's CPU
37 \ingroup system
38
39 This is an API for managing interrupts, their masks, and their
40 handler routines along with thread context information.
41
42 \warning
43 This is a low-level, internal kernel API. Many of these
44 interrupts are utilized by various KOS drivers and have higher-level APIs
45 for hooking into them. Care must be taken to not interfere with the IRQ
46 handling which is being done by in-use KOS drivers.
47
48 \note
49 The naming convention used by this API differs from that of the actual SH4
50 manual for historical reasons (it wasn't platform-specific). The SH4 manual
51 refers to the most general type of CPU events which result in a SW
52 callback as "exceptions," with "interrupts" and "general exceptions" being
53 subtypes of exceptions. This API uses the term "interrupt" and "exception"
54 interchangeably, except where it is explicitly noted that "SH4 interrupts"
55 or "SH4 general exceptions" are being referred to, more specifically.
56
57 @{
58*/
59
60/** \defgroup irq_context Context
61 \brief Thread execution state and accessors
62
63 This API includes the structure and accessors for a
64 thread's context state, which contains the registers that are stored
65 and loaded upon thread context switches, which are passed back to
66 interrupt handlers.
67
68 @{
69*/
70
71/** The number of bytes required to save thread context.
72
73 This should include all general CPU registers, FP registers, and status regs
74 (even if not all of these are actually used).
75
76 \note
77 On the Dreamcast, we need `228` bytes for all of that, but we round it up to a
78 nicer number for sanity.
79*/
80#define REG_BYTE_CNT 256
81
82/** Architecture-specific structure for holding the processor state.
83
84 This structure should hold register values and other important parts of the
85 processor state.
86
87 \note
88 The size of this structure should be less than or equal to the
89 \ref REG_BYTE_CNT value.
90*/
91typedef __attribute__((aligned(32))) struct irq_context {
92 uint32_t pc; /**< Program counter */
93 uint32_t pr; /**< Procedure register (aka return address) */
94 uint32_t gbr; /**< Global base register (TLS segment ptr) */
95 uint32_t vbr; /**< Vector base register */
96 uint32_t mach; /**< Multiply-and-accumulate register (high) */
97 uint32_t macl; /**< Multiply-and-accumulate register (low) */
98 uint32_t sr; /**< Status register */
99 uint32_t fpul; /**< Floating-point communication register */
100 uint32_t fr[16]; /**< Primary floating point registers */
101 uint32_t frbank[16]; /**< Secondary floating point registers */
102 uint32_t r[16]; /**< 16 general purpose (integer) registers */
103 uint32_t fpscr; /**< Floating-point status/control register */
105
106/* Included for legacy compatibility with these two APIs being one. */
107#include <arch/trap.h>
108
109/** \name Register Accessors
110 \brief Convenience macros for accessing context registers
111 @{
112*/
113/** Fetch the program counter from an irq_context_t.
114 \param c The context to read from.
115 \return The program counter value.
116*/
117#define CONTEXT_PC(c) ((c).pc)
118
119/** Fetch the frame pointer from an irq_context_t.
120 \param c The context to read from.
121 \return The frame pointer value.
122*/
123#define CONTEXT_FP(c) ((c).r[14])
124
125/** Fetch the stack pointer from an irq_context_t.
126 \param c The context to read from.
127 \return The stack pointer value.
128*/
129#define CONTEXT_SP(c) ((c).r[15])
130
131/** Fetch the return value from an irq_context_t.
132 \param c The context to read from.
133 \return The return value.
134*/
135#define CONTEXT_RET(c) ((c).r[0])
136/** @} */
137
138/** Switch out contexts (for interrupt return).
139
140 This function will set the processor state that will be restored when the
141 exception returns.
142
143 \param regbank The values of all registers to be restored.
144
145 \sa irq_get_context()
146*/
148
149/** Get the current IRQ context.
150
151 This will fetch the processor context prior to the exception handling during
152 an IRQ service routine.
153
154 \return The current IRQ context.
155
156 \sa irq_set_context()
157*/
159
160/** Fill a newly allocated context block.
161
162 The given parameters will be passed to the called routine (up to the
163 architecture maximum). For the Dreamcast, this maximum is 4.
164
165 \param context The IRQ context to fill in.
166 \param stack_pointer The value to set in the stack pointer.
167 \param routine The address of the program counter for the context.
168 \param args Any arguments to set in the registers. This cannot
169 be NULL, and must have enough values to fill in up
170 to the architecture maximum.
171 \param usermode true to run the routine in user mode, false for
172 supervisor.
173*/
174void irq_create_context(irq_context_t *context, uint32_t stack_pointer,
175 uint32_t routine, const uint32_t *args, bool usermode);
176
177/** @} */
178
179/** Interrupt exception codes
180
181 SH-specific exception codes. Used to identify the source or type of an
182 interrupt. Each exception code is of a certain "type" which dictates how the
183 interrupt is generated and handled.
184
185 List of exception types:
186
187 |Type | Description
188 |--------|------------
189 |`RESET` | Caused by system reset. Uncatchable and fatal. Automatically branch to address `0xA0000000`.
190 |`REEXEC`| Restarts current instruction after interrupt processing. Context PC is the triggering instruction.
191 |`POST` | Continues with next instruciton after interrupt processing. Context PC is the next instruction.
192 |`SOFT` | Software-driven exceptions for triggering interrupts upon special events.
193 |`UNUSED`| Known to not be present and usable with the DC's SH4 configuration.
194
195 List of exception codes:
196*/
197typedef enum irq_exception {
198 EXC_RESET_POWERON = 0x0000, /**< `[RESET ]` Power-on reset */
199 EXC_RESET_MANUAL = 0x0020, /**< `[RESET ]` Manual reset */
200 EXC_RESET_UDI = 0x0000, /**< `[RESET ]` Hitachi UDI reset */
201 EXC_ITLB_MULTIPLE = 0x0140, /**< `[RESET ]` Instruction TLB multiple hit */
202 EXC_DTLB_MULTIPLE = 0x0140, /**< `[RESET ]` Data TLB multiple hit */
203 EXC_USER_BREAK_PRE = 0x01e0, /**< `[REEXEC]` User break before instruction */
204 EXC_INSTR_ADDRESS = 0x00e0, /**< `[REEXEC]` Instruction address */
205 EXC_ITLB_MISS = 0x0040, /**< `[REEXEC]` Instruction TLB miss */
206 EXC_ITLB_PV = 0x00a0, /**< `[REEXEC]` Instruction TLB protection violation */
207 EXC_ILLEGAL_INSTR = 0x0180, /**< `[REEXEC]` Illegal instruction */
208 EXC_SLOT_ILLEGAL_INSTR = 0x01a0, /**< `[REEXEC]` Slot illegal instruction */
209 EXC_GENERAL_FPU = 0x0800, /**< `[REEXEC]` General FPU exception */
210 EXC_SLOT_FPU = 0x0820, /**< `[REEXEC]` Slot FPU exception */
211 EXC_DATA_ADDRESS_READ = 0x00e0, /**< `[REEXEC]` Data address (read) */
212 EXC_DATA_ADDRESS_WRITE = 0x0100, /**< `[REEXEC]` Data address (write) */
213 EXC_DTLB_MISS_READ = 0x0040, /**< `[REEXEC]` Data TLB miss (read) */
214 EXC_DTLB_MISS_WRITE = 0x0060, /**< `[REEXEC]` Data TLB miss (write) */
215 EXC_DTLB_PV_READ = 0x00a0, /**< `[REEXEC]` Data TLB protection violation (read) */
216 EXC_DTLB_PV_WRITE = 0x00c0, /**< `[REEXEC]` Data TLB protection violation (write) */
217 EXC_FPU = 0x0120, /**< `[REEXEC]` FPU exception */
218 EXC_INITIAL_PAGE_WRITE = 0x0080, /**< `[REEXEC]` Initial page write exception */
219 EXC_TRAPA = 0x0160, /**< `[POST ]` Unconditional trap (`TRAPA`) */
220 EXC_USER_BREAK_POST = 0x01e0, /**< `[POST ]` User break after instruction */
221 EXC_NMI = 0x01c0, /**< `[POST ]` Nonmaskable interrupt */
222 EXC_IRQ0 = 0x0200, /**< `[POST ]` External IRQ request (level 0) */
223 EXC_IRQ1 = 0x0220, /**< `[POST ]` External IRQ request (level 1) */
224 EXC_IRQ2 = 0x0240, /**< `[POST ]` External IRQ request (level 2) */
225 EXC_IRQ3 = 0x0260, /**< `[POST ]` External IRQ request (level 3) */
226 EXC_IRQ4 = 0x0280, /**< `[POST ]` External IRQ request (level 4) */
227 EXC_IRQ5 = 0x02a0, /**< `[POST ]` External IRQ request (level 5) */
228 EXC_IRQ6 = 0x02c0, /**< `[POST ]` External IRQ request (level 6) */
229 EXC_IRQ7 = 0x02e0, /**< `[POST ]` External IRQ request (level 7) */
230 EXC_IRQ8 = 0x0300, /**< `[POST ]` External IRQ request (level 8) */
231 EXC_IRQ9 = 0x0320, /**< `[POST ]` External IRQ request (level 9) */
232 EXC_IRQA = 0x0340, /**< `[POST ]` External IRQ request (level 10) */
233 EXC_IRQB = 0x0360, /**< `[POST ]` External IRQ request (level 11) */
234 EXC_IRQC = 0x0380, /**< `[POST ]` External IRQ request (level 12) */
235 EXC_IRQD = 0x03a0, /**< `[POST ]` External IRQ request (level 13) */
236 EXC_IRQE = 0x03c0, /**< `[POST ]` External IRQ request (level 14) */
237 EXC_TMU0_TUNI0 = 0x0400, /**< `[POST ]` TMU0 underflow */
238 EXC_TMU1_TUNI1 = 0x0420, /**< `[POST ]` TMU1 underflow */
239 EXC_TMU2_TUNI2 = 0x0440, /**< `[POST ]` TMU2 underflow */
240 EXC_TMU2_TICPI2 = 0x0460, /**< `[UNUSED]` TMU2 input capture */
241 EXC_RTC_ATI = 0x0480, /**< `[UNUSED]` RTC alarm interrupt */
242 EXC_RTC_PRI = 0x04a0, /**< `[UNUSED]` RTC periodic interrupt */
243 EXC_RTC_CUI = 0x04c0, /**< `[UNUSED]` RTC carry interrupt */
244 EXC_SCI_ERI = 0x04e0, /**< `[UNUSED]` SCI Error receive */
245 EXC_SCI_RXI = 0x0500, /**< `[UNUSED]` SCI Receive ready */
246 EXC_SCI_TXI = 0x0520, /**< `[UNUSED]` SCI Transmit ready */
247 EXC_SCI_TEI = 0x0540, /**< `[UNUSED]` SCI Transmit error */
248 EXC_WDT_ITI = 0x0560, /**< `[POST ]` Watchdog timer */
249 EXC_REF_RCMI = 0x0580, /**< `[POST ]` Memory refresh compare-match interrupt */
250 EXC_REF_ROVI = 0x05a0, /**< `[POST ]` Memory refresh counter overflow interrupt */
251 EXC_UDI = 0x0600, /**< `[POST ]` Hitachi UDI */
252 EXC_GPIO_GPIOI = 0x0620, /**< `[POST ]` I/O port interrupt */
253 EXC_DMAC_DMTE0 = 0x0640, /**< `[POST ]` DMAC transfer end (channel 0) */
254 EXC_DMAC_DMTE1 = 0x0660, /**< `[POST ]` DMAC transfer end (channel 1) */
255 EXC_DMAC_DMTE2 = 0x0680, /**< `[POST ]` DMAC transfer end (channel 2) */
256 EXC_DMAC_DMTE3 = 0x06a0, /**< `[POST ]` DMAC transfer end (channel 3) */
257 EXC_DMA_DMAE = 0x06c0, /**< `[POST ]` DMAC address error */
258 EXC_SCIF_ERI = 0x0700, /**< `[POST ]` SCIF Error receive */
259 EXC_SCIF_RXI = 0x0720, /**< `[POST ]` SCIF Receive ready */
260 EXC_SCIF_BRI = 0x0740, /**< `[POST ]` SCIF break */
261 EXC_SCIF_TXI = 0x0760, /**< `[POST ]` SCIF Transmit ready */
262 EXC_DOUBLE_FAULT = 0x0780, /**< `[SOFT ]` Exception happened in an ISR */
263 EXC_UNHANDLED_EXC = 0x07e0 /**< `[SOFT ]` Exception went unhandled */
265
266/** \defgroup irq_state State
267 \brief Methods for querying active IRQ information.
268
269 Provides an API for accessing the state of the current IRQ context such
270 as the active interrupt or whether it has been handled.
271
272 @{
273*/
274
275
276/** Returns whether inside of an interrupt context.
277
278 \retval non-zero If interrupt handling is in progress.
279 ((code&0xf)<<16) | (evt&0xffff)
280 \retval 0 If normal processing is in progress.
281
282*/
284
285/** @} */
286
287/** \defgroup irq_mask Mask
288 \brief Accessors and modifiers of the IMASK state.
289
290 This API is provided for managing and querying information regarding the
291 interrupt mask, a series of bitflags representing whether each type of
292 interrupt has been enabled or not.
293
294 @{
295*/
296
297/** Type representing an interrupt mask state. */
299
300/** Get status register contents.
301
302 Returns the current value of the status register, as irq_disable() does.
303 The function can be found in arch\dreamcast\kernel\entry.s
304
305 \note
306 This is the entire status register word, not just the `IMASK` field.
307
308 \retval Status register word
309 \sa irq_disable()
310*/
311static inline irq_mask_t irq_get_sr(void) {
312 irq_mask_t value;
313 __asm__ volatile("stc sr, %0" : "=r" (value));
314 return value;
315}
316
317/** Restore IRQ state.
318
319 This function will restore the interrupt state to the value specified. This
320 should correspond to a value returned by irq_disable().
321
322 \param v The IRQ state to restore. This should be a value
323 returned by irq_disable().
324
325 \sa irq_disable()
326*/
327static inline void irq_restore(irq_mask_t old) {
328 __asm__ volatile("ldc %0, sr" : : "r" (old));
329}
330
331/** Disable interrupts.
332
333 This function will disable SH4 interrupts, but will leave SH4 general
334 exceptions enabled.
335
336 \return The state of the SH4 interrupts before calling the
337 function. This can be used to restore this state
338 later on with irq_restore().
339
340 \sa irq_restore(), irq_enable()
341*/
342static inline irq_mask_t irq_disable(void) {
343 uint32_t mask = (uint32_t)irq_get_sr();
344 irq_restore((mask & 0xefffff0f) | 0x000000f0);
345 return mask;
346}
347
348/** Enable all interrupts.
349
350 This function will enable ALL interrupts, including external ones.
351
352 \sa irq_disable()
353*/
354static inline void irq_enable(void) {
355 uint32_t mask = ((uint32_t)irq_get_sr() & 0xefffff0f);
356 irq_restore(mask);
357}
358
359/** \brief Disable interrupts with scope management.
360
361 This macro will disable interrupts, similarly to irq_disable(), with the
362 difference that the interrupt state will automatically be restored once the
363 execution exits the functional block in which the macro was called.
364*/
365#define irq_disable_scoped() __irq_disable_scoped(__LINE__)
366
367/** @} */
368
369/** \defgroup irq_ctrl Control Flow
370 \brief Methods for managing control flow within an irq_handler.
371
372 This API provides methods for controlling program flow from within an
373 active interrupt handler.
374
375 @{
376*/
377
378/** Resume normal execution from IRQ context.
379
380 Pretend like we just came in from an interrupt and force a context switch
381 back to the "current" context.
382
383 \warning
384 Make sure you've called irq_set_context() before doing this!
385
386 \sa irq_set_context()
387*/
389
390/** @} */
391
392/** \defgroup irq_handlers Handlers
393 \brief API for managing IRQ handlers
394
395 This API provides a series of methods for registering and retrieving
396 different types of exception handlers.
397
398 @{
399*/
400
401/** The type of an IRQ handler.
402
403 \param code The IRQ that caused the handler to be called.
404 \param context The CPU's context.
405 \param data Arbitrary userdata associated with the handler.
406*/
407typedef void (*irq_handler)(irq_t code, irq_context_t *context, void *data);
408
409
410/** The type of a full callback of an IRQ handler and userdata.
411
412 This type is used to set or get IRQ handlers and their data.
413*/
414typedef struct irq_cb {
415 irq_handler hdl; /**< A pointer to a procedure to handle an exception. */
416 void *data; /**< A pointer that will be passed along to the callback. */
417} irq_cb_t;
418
419/** \defgroup irq_handlers_ind Individual
420 \brief API for managing individual IRQ handlers.
421
422 This API is for managing handlers installed to handle individual IRQ codes.
423
424 @{
425*/
426
427/** Set or remove an IRQ handler.
428
429 Passing a NULL value for hnd will remove the current handler, if any.
430
431 \param code The IRQ type to set the handler for
432 (see #irq_t).
433 \param hnd A pointer to a procedure to handle the exception.
434 \param data A pointer that will be passed along to the callback.
435
436 \retval 0 On success.
437 \retval -1 If the code is invalid.
438
439 \sa irq_get_handler()
440*/
441int irq_set_handler(irq_t code, irq_handler hnd, void *data);
442
443/** Get the address of the current handler for the IRQ type.
444
445 \param code The IRQ type to look up.
446
447 \return The current handler for the IRQ type and
448 its userdata.
449
450 \sa irq_set_handler()
451*/
453
454/** @} */
455
456/** \defgroup irq_handlers_global Global
457 \brief API for managing global IRQ handler.
458
459 @{
460*/
461/** Set a global exception handler.
462
463 This function sets a global catch-all filter for all exception types.
464
465 \note The specific handler will still be called for the
466 exception if one is set. If not, setting one of
467 these will stop the unhandled exception error.
468
469 \param hnd A pointer to the procedure to handle the exception.
470 \param data A pointer that will be passed along to the callback.
471
472 \retval 0 On success (no error conditions defined).
473
474*/
476
477/** Get the global exception handler.
478
479 \return The global exception handler and userdata set with
480 irq_set_global_handler(), or NULL if none is set.
481*/
483/** @} */
484
485/** @} */
486
487/** \cond INTERNAL */
488
489/** Initialize interrupts.
490
491 \retval 0 On success (no error conditions defined).
492
493 \sa irq_shutdown()
494*/
495int irq_init(void);
496
497/** Shutdown interrupts.
498
499 Restores the state to how it was before irq_init() was called.
500
501 \sa irq_init()
502*/
503void irq_shutdown(void);
504
505static inline void __irq_scoped_cleanup(irq_mask_t *state) {
506 irq_restore(*state);
507}
508
509#define ___irq_disable_scoped(l) \
510 irq_mask_t __scoped_irq_##l __attribute__((cleanup(__irq_scoped_cleanup))) = irq_disable()
511
512#define __irq_disable_scoped(l) ___irq_disable_scoped(l)
513/** \endcond */
514
515/** \brief Minimum/maximum values for IRQ priorities
516
517 A priority of zero means the interrupt is masked.
518 The maximum priority that can be set is 15.
519 */
520#define IRQ_PRIO_MAX 15
521#define IRQ_PRIO_MIN 1
522#define IRQ_PRIO_MASKED 0
523
524/** \brief Interrupt sources
525
526 Interrupt sources at the SH4 level.
527 */
546
547/** \brief Set the priority of a given IRQ source
548
549 This function can be used to set the priority of a given IRQ source.
550
551 \param src The interrupt source whose priority should be set
552 \param prio The priority to set, in the range [0..15],
553 0 meaning the IRQs from that source are masked.
554*/
555void irq_set_priority(irq_src_t src, unsigned int prio);
556
557/** \brief Get the priority of a given IRQ source
558
559 This function returns the priority of a given IRQ source.
560
561 \param src The interrupt source whose priority should be set
562 \return The priority of the IRQ source.
563 A value of 0 means the IRQs are masked.
564*/
565unsigned int irq_get_priority(irq_src_t src);
566
567/** @} */
568
569__END_DECLS
570
571#endif /* __ARCH_IRQ_H */
Various common macros used throughout the codebase.
irq_context_t * irq_get_context(void)
Get the current IRQ context.
void irq_create_context(irq_context_t *context, uint32_t stack_pointer, uint32_t routine, const uint32_t *args, bool usermode)
Fill a newly allocated context block.
void irq_set_context(irq_context_t *regbank)
Switch out contexts (for interrupt return).
void irq_force_return(void)
Resume normal execution from IRQ context.
int irq_set_global_handler(irq_handler hnd, void *data)
Set a global exception handler.
irq_cb_t irq_get_global_handler(void)
Get the global exception handler.
int irq_set_handler(irq_t code, irq_handler hnd, void *data)
Set or remove an IRQ handler.
irq_cb_t irq_get_handler(irq_t code)
Get the address of the current handler for the IRQ type.
void(* irq_handler)(irq_t code, irq_context_t *context, void *data)
The type of an IRQ handler.
Definition irq.h:407
static void irq_enable(void)
Enable all interrupts.
Definition irq.h:354
static irq_mask_t irq_disable(void)
Disable interrupts.
Definition irq.h:342
static void irq_restore(irq_mask_t old)
Restore IRQ state.
Definition irq.h:327
uint32_t irq_mask_t
Type representing an interrupt mask state.
Definition irq.h:298
static irq_mask_t irq_get_sr(void)
Get status register contents.
Definition irq.h:311
int irq_inside_int(void)
Returns whether inside of an interrupt context.
irq_src_t
Interrupt sources.
Definition irq.h:528
void irq_set_priority(irq_src_t src, unsigned int prio)
Set the priority of a given IRQ source.
irq_t
Interrupt exception codes.
Definition irq.h:197
unsigned int irq_get_priority(irq_src_t src)
Get the priority of a given IRQ source.
@ IRQ_SRC_IRL2
Definition irq.h:542
@ IRQ_SRC_REF
Definition irq.h:535
@ IRQ_SRC_TMU1
Definition irq.h:531
@ IRQ_SRC_GPIO
Definition irq.h:540
@ IRQ_SRC_RTC
Definition irq.h:529
@ IRQ_SRC_WDT
Definition irq.h:536
@ IRQ_SRC_TMU2
Definition irq.h:530
@ IRQ_SRC_TMU0
Definition irq.h:532
@ IRQ_SRC_HUDI
Definition irq.h:537
@ IRQ_SRC_IRL3
Definition irq.h:541
@ IRQ_SRC_IRL0
Definition irq.h:544
@ IRQ_SRC_DMAC
Definition irq.h:539
@ _IRQ_SRC_RESV
Definition irq.h:533
@ IRQ_SRC_SCIF
Definition irq.h:538
@ IRQ_SRC_SCI1
Definition irq.h:534
@ IRQ_SRC_IRL1
Definition irq.h:543
@ EXC_SCIF_TXI
[POST ] SCIF Transmit ready
Definition irq.h:261
@ EXC_TMU1_TUNI1
[POST ] TMU1 underflow
Definition irq.h:238
@ EXC_UNHANDLED_EXC
[SOFT ] Exception went unhandled
Definition irq.h:263
@ EXC_DTLB_MISS_READ
[REEXEC] Data TLB miss (read)
Definition irq.h:213
@ EXC_TMU2_TUNI2
[POST ] TMU2 underflow
Definition irq.h:239
@ EXC_DATA_ADDRESS_READ
[REEXEC] Data address (read)
Definition irq.h:211
@ EXC_DMAC_DMTE2
[POST ] DMAC transfer end (channel 2)
Definition irq.h:255
@ EXC_DTLB_MULTIPLE
[RESET ] Data TLB multiple hit
Definition irq.h:202
@ EXC_DTLB_PV_READ
[REEXEC] Data TLB protection violation (read)
Definition irq.h:215
@ EXC_ITLB_MISS
[REEXEC] Instruction TLB miss
Definition irq.h:205
@ EXC_SCI_ERI
[UNUSED] SCI Error receive
Definition irq.h:244
@ EXC_DMAC_DMTE1
[POST ] DMAC transfer end (channel 1)
Definition irq.h:254
@ EXC_IRQ9
[POST ] External IRQ request (level 9)
Definition irq.h:231
@ EXC_IRQ0
[POST ] External IRQ request (level 0)
Definition irq.h:222
@ EXC_INSTR_ADDRESS
[REEXEC] Instruction address
Definition irq.h:204
@ EXC_REF_RCMI
[POST ] Memory refresh compare-match interrupt
Definition irq.h:249
@ EXC_DMAC_DMTE0
[POST ] DMAC transfer end (channel 0)
Definition irq.h:253
@ EXC_ITLB_MULTIPLE
[RESET ] Instruction TLB multiple hit
Definition irq.h:201
@ EXC_IRQ7
[POST ] External IRQ request (level 7)
Definition irq.h:229
@ EXC_INITIAL_PAGE_WRITE
[REEXEC] Initial page write exception
Definition irq.h:218
@ EXC_DTLB_MISS_WRITE
[REEXEC] Data TLB miss (write)
Definition irq.h:214
@ EXC_SLOT_FPU
[REEXEC] Slot FPU exception
Definition irq.h:210
@ EXC_IRQA
[POST ] External IRQ request (level 10)
Definition irq.h:232
@ EXC_RESET_POWERON
[RESET ] Power-on reset
Definition irq.h:198
@ EXC_IRQ4
[POST ] External IRQ request (level 4)
Definition irq.h:226
@ EXC_IRQD
[POST ] External IRQ request (level 13)
Definition irq.h:235
@ EXC_RTC_ATI
[UNUSED] RTC alarm interrupt
Definition irq.h:241
@ EXC_RESET_MANUAL
[RESET ] Manual reset
Definition irq.h:199
@ EXC_DOUBLE_FAULT
[SOFT ] Exception happened in an ISR
Definition irq.h:262
@ EXC_DMAC_DMTE3
[POST ] DMAC transfer end (channel 3)
Definition irq.h:256
@ EXC_ILLEGAL_INSTR
[REEXEC] Illegal instruction
Definition irq.h:207
@ EXC_FPU
[REEXEC] FPU exception
Definition irq.h:217
@ EXC_IRQ8
[POST ] External IRQ request (level 8)
Definition irq.h:230
@ EXC_IRQC
[POST ] External IRQ request (level 12)
Definition irq.h:234
@ EXC_TMU0_TUNI0
[POST ] TMU0 underflow
Definition irq.h:237
@ EXC_IRQ1
[POST ] External IRQ request (level 1)
Definition irq.h:223
@ EXC_RTC_PRI
[UNUSED] RTC periodic interrupt
Definition irq.h:242
@ EXC_GPIO_GPIOI
[POST ] I/O port interrupt
Definition irq.h:252
@ EXC_DATA_ADDRESS_WRITE
[REEXEC] Data address (write)
Definition irq.h:212
@ EXC_IRQ6
[POST ] External IRQ request (level 6)
Definition irq.h:228
@ EXC_DMA_DMAE
[POST ] DMAC address error
Definition irq.h:257
@ EXC_REF_ROVI
[POST ] Memory refresh counter overflow interrupt
Definition irq.h:250
@ EXC_IRQ5
[POST ] External IRQ request (level 5)
Definition irq.h:227
@ EXC_SLOT_ILLEGAL_INSTR
[REEXEC] Slot illegal instruction
Definition irq.h:208
@ EXC_WDT_ITI
[POST ] Watchdog timer
Definition irq.h:248
@ EXC_IRQ2
[POST ] External IRQ request (level 2)
Definition irq.h:224
@ EXC_SCI_TXI
[UNUSED] SCI Transmit ready
Definition irq.h:246
@ EXC_ITLB_PV
[REEXEC] Instruction TLB protection violation
Definition irq.h:206
@ EXC_SCIF_BRI
[POST ] SCIF break
Definition irq.h:260
@ EXC_IRQB
[POST ] External IRQ request (level 11)
Definition irq.h:233
@ EXC_USER_BREAK_PRE
[REEXEC] User break before instruction
Definition irq.h:203
@ EXC_NMI
[POST ] Nonmaskable interrupt
Definition irq.h:221
@ EXC_RESET_UDI
[RESET ] Hitachi UDI reset
Definition irq.h:200
@ EXC_USER_BREAK_POST
[POST ] User break after instruction
Definition irq.h:220
@ EXC_SCIF_RXI
[POST ] SCIF Receive ready
Definition irq.h:259
@ EXC_DTLB_PV_WRITE
[REEXEC] Data TLB protection violation (write)
Definition irq.h:216
@ EXC_IRQ3
[POST ] External IRQ request (level 3)
Definition irq.h:225
@ EXC_TMU2_TICPI2
[UNUSED] TMU2 input capture
Definition irq.h:240
@ EXC_GENERAL_FPU
[REEXEC] General FPU exception
Definition irq.h:209
@ EXC_TRAPA
[POST ] Unconditional trap (TRAPA)
Definition irq.h:219
@ EXC_SCIF_ERI
[POST ] SCIF Error receive
Definition irq.h:258
@ EXC_SCI_RXI
[UNUSED] SCI Receive ready
Definition irq.h:245
@ EXC_UDI
[POST ] Hitachi UDI
Definition irq.h:251
@ EXC_SCI_TEI
[UNUSED] SCI Transmit error
Definition irq.h:247
@ EXC_IRQE
[POST ] External IRQ request (level 14)
Definition irq.h:236
@ EXC_RTC_CUI
[UNUSED] RTC carry interrupt
Definition irq.h:243
static uint32_t("Please see purupuru_effect_t for modern equivalent.") PURUPURU_EFFECT2_UINTENSITY(uint8_t x)
Definition purupuru.h:96
The type of a full callback of an IRQ handler and userdata.
Definition irq.h:414
void * data
A pointer that will be passed along to the callback.
Definition irq.h:416
irq_handler hdl
A pointer to a procedure to handle an exception.
Definition irq.h:415
Architecture-specific structure for holding the processor state.
Definition irq.h:91
uint32_t fpul
Floating-point communication register.
Definition irq.h:99
uint32_t sr
Status register.
Definition irq.h:98
uint32_t mach
Multiply-and-accumulate register (high)
Definition irq.h:96
uint32_t fpscr
Floating-point status/control register.
Definition irq.h:103
uint32_t macl
Multiply-and-accumulate register (low)
Definition irq.h:97
uint32_t vbr
Vector base register.
Definition irq.h:95
uint32_t pc
Program counter.
Definition irq.h:92
uint32_t gbr
Global base register (TLS segment ptr)
Definition irq.h:94
uint32_t pr
Procedure register (aka return address)
Definition irq.h:93
Interrupt and exception handling.