summaryrefslogtreecommitdiff
path: root/hal/interrupt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hal/interrupt.cpp')
-rw-r--r--hal/interrupt.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/hal/interrupt.cpp b/hal/interrupt.cpp
index e9e7b24..611b09c 100644
--- a/hal/interrupt.cpp
+++ b/hal/interrupt.cpp
@@ -1,9 +1,21 @@
#include "interrupt.h"
+namespace Interrupt {
+ MFP mf_vectors[16 + NUM_IRQs];
+};
+
void entry();
+void member_function_interrupt_gate() {
+ uint32_t interrupt_num;
+ asm ("mrs %0, ipsr" : "=r" (interrupt_num));
+
+ Interrupt::mf_vectors[interrupt_num].func_p(Interrupt::mf_vectors[interrupt_num].instance_p);
+}
+
extern "C" void unused_interrupt() {
- while(1) {}
+ member_function_interrupt_gate();
+ //while(1);
}
template<> void interrupt<Interrupt::NMI>() __attribute__ ((weak, alias ("unused_interrupt")));