83#define REG_BYTE_CNT 256
94struct __attribute__((aligned(32))) irq_context {
117#define CONTEXT_PC(c) ((c).pc)
123#define CONTEXT_FP(c) ((c).r[14])
129#define CONTEXT_SP(c) ((c).r[15])
135#define CONTEXT_RET(c) ((c).r[0])
164 EXC_RESET_POWERON = 0x0000,
165 EXC_RESET_MANUAL = 0x0020,
166 EXC_RESET_UDI = 0x0000,
167 EXC_ITLB_MULTIPLE = 0x0140,
168 EXC_DTLB_MULTIPLE = 0x0140,
169 EXC_USER_BREAK_PRE = 0x01e0,
170 EXC_INSTR_ADDRESS = 0x00e0,
171 EXC_ITLB_MISS = 0x0040,
172 EXC_ITLB_PV = 0x00a0,
173 EXC_ILLEGAL_INSTR = 0x0180,
174 EXC_SLOT_ILLEGAL_INSTR = 0x01a0,
175 EXC_GENERAL_FPU = 0x0800,
176 EXC_SLOT_FPU = 0x0820,
177 EXC_DATA_ADDRESS_READ = 0x00e0,
178 EXC_DATA_ADDRESS_WRITE = 0x0100,
179 EXC_DTLB_MISS_READ = 0x0040,
180 EXC_DTLB_MISS_WRITE = 0x0060,
181 EXC_DTLB_PV_READ = 0x00a0,
182 EXC_DTLB_PV_WRITE = 0x00c0,
184 EXC_INITIAL_PAGE_WRITE = 0x0080,
186 EXC_USER_BREAK_POST = 0x01e0,
203 EXC_TMU0_TUNI0 = 0x0400,
204 EXC_TMU1_TUNI1 = 0x0420,
205 EXC_TMU2_TUNI2 = 0x0440,
206 EXC_TMU2_TICPI2 = 0x0460,
207 EXC_RTC_ATI = 0x0480,
208 EXC_RTC_PRI = 0x04a0,
209 EXC_RTC_CUI = 0x04c0,
210 EXC_SCI_ERI = 0x04e0,
211 EXC_SCI_RXI = 0x0500,
212 EXC_SCI_TXI = 0x0520,
213 EXC_SCI_TEI = 0x0540,
214 EXC_WDT_ITI = 0x0560,
215 EXC_REF_RCMI = 0x0580,
216 EXC_REF_ROVI = 0x05a0,
218 EXC_GPIO_GPIOI = 0x0620,
219 EXC_DMAC_DMTE0 = 0x0640,
220 EXC_DMAC_DMTE1 = 0x0660,
221 EXC_DMAC_DMTE2 = 0x0680,
222 EXC_DMAC_DMTE3 = 0x06a0,
223 EXC_DMA_DMAE = 0x06c0,
224 EXC_SCIF_ERI = 0x0700,
225 EXC_SCIF_RXI = 0x0720,
226 EXC_SCIF_BRI = 0x0740,
227 EXC_SCIF_TXI = 0x0760,
228 EXC_DOUBLE_FAULT = 0x0780,
229 EXC_UNHANDLED_EXC = 0x07e0,
233#define IRQ_TRAP_CODE(code) (EXC_TRAP + (code))
235static inline int arch_irq_inside_int(
void) {
236 extern int inside_int;
241static inline void arch_irq_restore(
irq_mask_t old) {
242 __asm__
volatile(
"ldc %0, sr" : :
"r" (old));
245static inline irq_mask_t arch_irq_disable(
void) {
248 __asm__
volatile(
"stc sr, %0" :
"=r" (mask));
250 arch_irq_restore((mask & 0xefffff0f) | 0x000000f0);
254static inline void arch_irq_enable(
void) {
257 __asm__
volatile(
"stc sr, %0" :
"=r" (mask));
259 arch_irq_restore(mask & 0xefffff0f);
272 uintptr_t stack_pointer,
274 const uintptr_t *args);
282irq_cb_t arch_irq_get_global_handler(
void);
295#define IRQ_PRIO_MAX 15
296#define IRQ_PRIO_MIN 1
297#define IRQ_PRIO_MASKED 0
303typedef enum irq_src {
330void irq_set_priority(irq_src_t src,
unsigned int prio);
340unsigned int irq_get_priority(irq_src_t src);
void hnd(const char *file, int line, const char *expr, const char *msg, const char *func)
Definition asserthnd.c:53
static struct @69 data[BARRIER_COUNT]
static float r
Definition bubbles.c:95
static pvr_poly_cxt_t cxt
Definition bubbles.c:28
Various common macros used throughout the codebase.
enum irq_exception irq_t
Architecture-specific interrupt exception codes.
Definition irq.h:49
struct irq_context irq_context_t
Architecture-specific structure for holding the processor state.
Definition irq.h:43
uint32_t irq_mask_t
Type representing an interrupt mask state.
Definition irq.h:52
void(* irq_hdl_t)(irq_t code, irq_context_t *context, void *data)
The type of an IRQ handler.
Definition irq.h:60
The type of a full callback of an IRQ handler and userdata.
Definition irq.h:67