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 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 <sys/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
267/** \defgroup irq_type_offsets Exception type offsets
268 \brief Offsets within exception types
269 \ingroup irqs
270
271 The following are a table of "type offsets" (see the Hitachi PDF). These are
272 the 0x000, 0x100, 0x400, and 0x600 offsets.
273
274 @{
275*/
276#define EXC_OFFSET_000 0 /**< \brief Offset 0x000 */
277#define EXC_OFFSET_100 1 /**< \brief Offset 0x100 */
278#define EXC_OFFSET_400 2 /**< \brief Offset 0x400 */
279#define EXC_OFFSET_600 3 /**< \brief Offset 0x600 */
280/** @} */
281
282/** \brief The value of the timer IRQ
283 \ingroup irqs
284*/
285#define TIMER_IRQ EXC_TMU0_TUNI0
286
287/** \defgroup irq_state State
288 \brief Methods for querying active IRQ information.
289
290 Provides an API for accessing the state of the current IRQ context such
291 as the active interrupt or whether it has been handled.
292
293 @{
294*/
295
296
297/** Returns whether inside of an interrupt context.
298
299 \retval non-zero If interrupt handling is in progress.
300 ((code&0xf)<<16) | (evt&0xffff)
301 \retval 0 If normal processing is in progress.
302
303*/
305
306/** @} */
307
308/** \defgroup irq_mask Mask
309 \brief Accessors and modifiers of the IMASK state.
310
311 This API is provided for managing and querying information regarding the
312 interrupt mask, a series of bitflags representing whether each type of
313 interrupt has been enabled or not.
314
315 @{
316*/
317
318/** Type representing an interrupt mask state. */
319typedef uint32_t irq_mask_t;
320
321/** Get status register contents.
322
323 Returns the current value of the status register, as irq_disable() does.
324 The function can be found in arch\dreamcast\kernel\entry.s
325
326 \note
327 This is the entire status register word, not just the `IMASK` field.
328
329 \retval Status register word
330 \sa irq_disable()
331*/
333
334/** Disable interrupts.
335
336 This function will disable SH4 interrupts, but will leave SH4 general
337 exceptions enabled.
338
339 \return The state of the SH4 interrupts before calling the
340 function. This can be used to restore this state
341 later on with irq_restore().
342
343 \sa irq_restore(), irq_enable()
344*/
346
347/** Enable all interrupts.
348
349 This function will enable ALL interrupts, including external ones.
350
351 \sa irq_disable()
352*/
353void irq_enable(void);
354
355/** Restore IRQ state.
356
357 This function will restore the interrupt state to the value specified. This
358 should correspond to a value returned by irq_disable().
359
360 \param v The IRQ state to restore. This should be a value
361 returned by irq_disable().
362
363 \sa irq_disable()
364*/
366
367/** \brief Disable interrupts with scope management.
368
369 This macro will disable interrupts, similarly to irq_disable(), with the
370 difference that the interrupt state will automatically be restored once the
371 execution exits the functional block in which the macro was called.
372*/
373#define irq_disable_scoped() __irq_disable_scoped(__LINE__)
374
375/** @} */
376
377/** \defgroup irq_ctrl Control Flow
378 \brief Methods for managing control flow within an irq_handler.
379
380 This API provides methods for controlling program flow from within an
381 active interrupt handler.
382
383 @{
384*/
385
386/** Resume normal execution from IRQ context.
387
388 Pretend like we just came in from an interrupt and force a context switch
389 back to the "current" context.
390
391 \warning
392 Make sure you've called irq_set_context() before doing this!
393
394 \sa irq_set_context()
395*/
397
398/** @} */
399
400/** \defgroup irq_handlers Handlers
401 \brief API for managing IRQ handlers
402
403 This API provides a series of methods for registering and retrieving
404 different types of exception handlers.
405
406 @{
407*/
408
409/** The type of an IRQ handler.
410
411 \param code The IRQ that caused the handler to be called.
412 \param context The CPU's context.
413 \param data Arbitrary userdata associated with the handler.
414*/
415typedef void (*irq_handler)(irq_t code, irq_context_t *context, void *data);
416
417
418/** The type of a full callback of an IRQ handler and userdata.
419
420 This type is used to set or get IRQ handlers and their data.
421*/
422typedef struct irq_cb {
423 irq_handler hdl; /**< A pointer to a procedure to handle an exception. */
424 void *data; /**< A pointer that will be passed along to the callback. */
425} irq_cb_t;
426
427/** \defgroup irq_handlers_ind Individual
428 \brief API for managing individual IRQ handlers.
429
430 This API is for managing handlers installed to handle individual IRQ codes.
431
432 @{
433*/
434
435/** Set or remove an IRQ handler.
436
437 Passing a NULL value for hnd will remove the current handler, if any.
438
439 \param code The IRQ type to set the handler for
440 (see #irq_t).
441 \param hnd A pointer to a procedure to handle the exception.
442 \param data A pointer that will be passed along to the callback.
443
444 \retval 0 On success.
445 \retval -1 If the code is invalid.
446
447 \sa irq_get_handler()
448*/
449int irq_set_handler(irq_t code, irq_handler hnd, void *data);
450
451/** Get the address of the current handler for the IRQ type.
452
453 \param code The IRQ type to look up.
454
455 \return The current handler for the IRQ type and
456 its userdata.
457
458 \sa irq_set_handler()
459*/
461
462/** @} */
463
464/** \defgroup irq_handlers_global Global
465 \brief API for managing global IRQ handler.
466
467 @{
468*/
469/** Set a global exception handler.
470
471 This function sets a global catch-all filter for all exception types.
472
473 \note The specific handler will still be called for the
474 exception if one is set. If not, setting one of
475 these will stop the unhandled exception error.
476
477 \param hnd A pointer to the procedure to handle the exception.
478 \param data A pointer that will be passed along to the callback.
479
480 \retval 0 On success (no error conditions defined).
481
482*/
484
485/** Get the global exception handler.
486
487 \return The global exception handler and userdata set with
488 irq_set_global_handler(), or NULL if none is set.
489*/
491/** @} */
492
493/** @} */
494
495/** \cond INTERNAL */
496
497/** Initialize interrupts.
498
499 \retval 0 On success (no error conditions defined).
500
501 \sa irq_shutdown()
502*/
503int irq_init(void);
504
505/** Shutdown interrupts.
506
507 Restores the state to how it was before irq_init() was called.
508
509 \sa irq_init()
510*/
511void irq_shutdown(void);
512
513static inline void __irq_scoped_cleanup(irq_mask_t *state) {
514 irq_restore(*state);
515}
516
517#define ___irq_disable_scoped(l) \
518 irq_mask_t __scoped_irq_##l __attribute__((cleanup(__irq_scoped_cleanup))) = irq_disable()
519
520#define __irq_disable_scoped(l) ___irq_disable_scoped(l)
521/** \endcond */
522
523/** \brief Minimum/maximum values for IRQ priorities
524
525 A priority of zero means the interrupt is masked.
526 The maximum priority that can be set is 15.
527 */
528#define IRQ_PRIO_MAX 15
529#define IRQ_PRIO_MIN 1
530#define IRQ_PRIO_MASKED 0
531
532/** \brief Interrupt sources
533
534 Interrupt sources at the SH4 level.
535 */
554
555/** \brief Set the priority of a given IRQ source
556
557 This function can be used to set the priority of a given IRQ source.
558
559 \param src The interrupt source whose priority should be set
560 \param prio The priority to set, in the range [0..15],
561 0 meaning the IRQs from that source are masked.
562*/
563void irq_set_priority(irq_src_t src, unsigned int prio);
564
565/** \brief Get the priority of a given IRQ source
566
567 This function returns the priority of a given IRQ source.
568
569 \param src The interrupt source whose priority should be set
570 \return The priority of the IRQ source.
571 A value of 0 means the IRQs are masked.
572*/
573unsigned int irq_get_priority(irq_src_t src);
574
575/** @} */
576
577__END_DECLS
578
579#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 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:415
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:319
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:536
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:550
@ IRQ_SRC_REF
Definition irq.h:543
@ IRQ_SRC_TMU1
Definition irq.h:539
@ IRQ_SRC_GPIO
Definition irq.h:548
@ IRQ_SRC_RTC
Definition irq.h:537
@ IRQ_SRC_WDT
Definition irq.h:544
@ IRQ_SRC_TMU2
Definition irq.h:538
@ IRQ_SRC_TMU0
Definition irq.h:540
@ IRQ_SRC_HUDI
Definition irq.h:545
@ IRQ_SRC_IRL3
Definition irq.h:549
@ IRQ_SRC_IRL0
Definition irq.h:552
@ IRQ_SRC_DMAC
Definition irq.h:547
@ _IRQ_SRC_RESV
Definition irq.h:541
@ IRQ_SRC_SCIF
Definition irq.h:546
@ IRQ_SRC_SCI1
Definition irq.h:542
@ IRQ_SRC_IRL1
Definition irq.h:551
@ 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
The type of a full callback of an IRQ handler and userdata.
Definition irq.h:422
void * data
A pointer that will be passed along to the callback.
Definition irq.h:424
irq_handler hdl
A pointer to a procedure to handle an exception.
Definition irq.h:423
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.