summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/system.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/firmware/system.c b/firmware/system.c
index a3a354f713..3fcf37d297 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -170,7 +170,10 @@ bool detect_original_firmware(void)
170#if defined(CPU_ARM) 170#if defined(CPU_ARM)
171 171
172static const char* const uiename[] = { 172static const char* const uiename[] = {
173 "Undefined instruction", "Prefetch abort", "Data abort" 173 "Undefined instruction",
174 "Prefetch abort",
175 "Data abort",
176 "Divide by zero"
174}; 177};
175 178
176/* Unexpected Interrupt or Exception handler. Currently only deals with 179/* Unexpected Interrupt or Exception handler. Currently only deals with
@@ -197,5 +200,18 @@ void UIE(unsigned int pc, unsigned int num)
197 } 200 }
198} 201}
199 202
203#ifndef STUB
204/* Needs to be here or gcc won't find it */
205void __div0(void) __attribute__((naked));
206void __div0(void)
207{
208 asm volatile (
209 "ldr r0, [sp] \r\n"
210 "mov r1, #3 \r\n"
211 "b UIE \r\n"
212 );
213}
214#endif
215
200#endif /* CPU_ARM */ 216#endif /* CPU_ARM */
201 217