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