libctr9
Nintendo 3DS ARM9 library
ctr_interrupt.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2016 Gabriel Marcano
3  *
4  * Refer to the COPYING.txt file at the top of the project directory. If that is
5  * missing, this file is licensed under the GPL version 2.0 or later.
6  *
7  ******************************************************************************/
8 
11 //FIXME Document the fact that excpetion setup requires MPU to be setup so that
12 //ITCM is accessible from 0x0000 to 0x8000. Also, stacks must be setup (should
13 //I do that when I install the exceptions...?)
14 
15 #ifndef CTR_INTERRUPT_H_
16 #define CTR_INTERRUPT_H_
17 
18 #include <stdint.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
29 typedef enum
30 {
31  CTR_INTERRUPT_RESET,
32  CTR_INTERRUPT_UNDEF,
33  CTR_INTERRUPT_SWI,
34  CTR_INTERRUPT_PREABRT,
35  CTR_INTERRUPT_DATABRT,
36  CTR_INTERRUPT_IRQ,
37  CTR_INTERRUPT_FIQ
39 
43 
47 
56 void ctr_interrupt_prepare(void);
57 
79 void ctr_interrupt_set(ctr_interrupt_enum interrupt_type, void (*interrupt)(uint32_t*));
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif//CTR_INTERRUPT_H_
86 
void ctr_interrupt_global_disable(void)
Disables FIQ and IRQ interrupts.
void ctr_interrupt_prepare(void)
Sets up the exception vectors in ITCM.
void ctr_interrupt_set(ctr_interrupt_enum interrupt_type, void(*interrupt)(uint32_t *))
Sets up a handler for the given exception.
ctr_interrupt_enum
Enumerations for the different ARM9 CPU exceptions.
Definition: ctr_interrupt.h:29
void ctr_interrupt_global_enable(void)
Enables FIQ and IRQ interrupts.