mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Add divide-by-zero trap for ARM instead of just silently ignoring them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13832 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
07fabd1cd1
commit
01e8fce287
1 changed files with 17 additions and 1 deletions
|
@ -170,7 +170,10 @@ bool detect_original_firmware(void)
|
||||||
#if defined(CPU_ARM)
|
#if defined(CPU_ARM)
|
||||||
|
|
||||||
static const char* const uiename[] = {
|
static const char* const uiename[] = {
|
||||||
"Undefined instruction", "Prefetch abort", "Data abort"
|
"Undefined instruction",
|
||||||
|
"Prefetch abort",
|
||||||
|
"Data abort",
|
||||||
|
"Divide by zero"
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Unexpected Interrupt or Exception handler. Currently only deals with
|
/* Unexpected Interrupt or Exception handler. Currently only deals with
|
||||||
|
@ -197,5 +200,18 @@ void UIE(unsigned int pc, unsigned int num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef STUB
|
||||||
|
/* Needs to be here or gcc won't find it */
|
||||||
|
void __div0(void) __attribute__((naked));
|
||||||
|
void __div0(void)
|
||||||
|
{
|
||||||
|
asm volatile (
|
||||||
|
"ldr r0, [sp] \r\n"
|
||||||
|
"mov r1, #3 \r\n"
|
||||||
|
"b UIE \r\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* CPU_ARM */
|
#endif /* CPU_ARM */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue