diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 21:54:42 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-12-28 21:54:42 +0100 |
commit | 700f4c412d42c9b9811269045c0e363a0331bba9 (patch) | |
tree | 260feed1ca657843d993c1ae73e93f25a17cede1 /interrupts.c | |
parent | 80c9af17330ac442a4c3d6d55b4041cbe923e9b4 (diff) | |
download | rpi-MMU-example-700f4c412d42c9b9811269045c0e363a0331bba9.tar.gz rpi-MMU-example-700f4c412d42c9b9811269045c0e363a0331bba9.zip |
split kernel into 2 stages; second stage gets copied to 0x0 and runs from there
Diffstat (limited to 'interrupts.c')
-rw-r--r-- | interrupts.c | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/interrupts.c b/interrupts.c index 6952f89..1b0590a 100644 --- a/interrupts.c +++ b/interrupts.c @@ -1,10 +1,20 @@ #include "uart.h" -/** - @brief The undefined instruction interrupt handler - If an undefined instruction is encountered, the CPU will start - executing this function. Just trap here as a debug solution. -*/ +void setup(void); + +void reset_handler(void) +{ + static _Bool setup_done; + + if (!setup_done) + setup(); + + setup_done = 1; + + // TODO do something here + while(1); +} + void __attribute__((interrupt("UNDEF"))) __attribute__((section(".interrupts.text"))) @@ -17,13 +27,40 @@ undefined_instruction_vector(void) } } -void __attribute__((section(".interrupts.data"))) -(*system_reentry_point) (void); +void supervisor_call_handler(void) +{ + uart_puts("something svc happened\n\r"); + + while(1); +} void __attribute__((interrupt("ABORT"))) -__attribute__((section(".interrupts.text"))) abort_handler(void) { - system_reentry_point(); + uart_puts("re-entered system\n\r"); + + while(1); +} + +void generic_handler(void) +{ + uart_puts("something weird happened\n\r"); + + while(1); +} + +void irq_handler(void) +{ + uart_puts("irq happened\n\r"); + + while(1); +} + +void fiq_handler(void) +{ + uart_puts("fiq happened\n\r"); + + while(1); } + |