mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
arm: factor all exception handlers out of the crt0.S files
Remove the implementations of all exceptions handlers from the various crt0.S files and have a single implementation in system-arm.h The new implementation is weak so that it can be overwritten by some specific code (like the unwinder) Change-Id: Ib3e041ed6037376bbe0e79286057e1051640dd90 Reviewed-on: http://gerrit.rockbox.org/205 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
This commit is contained in:
parent
bb0e4cc543
commit
f33330c0ff
11 changed files with 50 additions and 312 deletions
|
|
@ -36,6 +36,56 @@ static const char* const uiename[] = {
|
|||
"SWI"
|
||||
};
|
||||
|
||||
void __attribute__((weak,naked)) data_abort_handler(void)
|
||||
{
|
||||
asm volatile(
|
||||
"sub r0, lr, #8 \n"
|
||||
"mov r1, #2 \n"
|
||||
"b UIE \n"
|
||||
);
|
||||
}
|
||||
|
||||
void __attribute__((weak,naked)) software_int_handler(void)
|
||||
{
|
||||
asm volatile(
|
||||
"sub r0, lr, #4 \n"
|
||||
"mov r1, #4 \n"
|
||||
"b UIE \n"
|
||||
);
|
||||
}
|
||||
|
||||
void __attribute__((weak,naked)) reserved_handler(void)
|
||||
{
|
||||
asm volatile(
|
||||
"sub r0, lr, #4 \n"
|
||||
"mov r1, #4 \n"
|
||||
"b UIE \n"
|
||||
);
|
||||
}
|
||||
|
||||
void __attribute__((weak,naked)) prefetch_abort_handler(void)
|
||||
{
|
||||
asm volatile(
|
||||
"sub r0, lr, #4 \n"
|
||||
"mov r1, #1 \n"
|
||||
"b UIE \n"
|
||||
);
|
||||
}
|
||||
|
||||
void __attribute__((weak,naked)) undef_instr_handler(void)
|
||||
{
|
||||
asm volatile(
|
||||
"sub r0, lr, #4 \n"
|
||||
#ifdef USE_THUMB
|
||||
"mrs r1, spsr \n"
|
||||
"tst r1, #(1 << 5) \n" // T bit set ?
|
||||
"subne r0, lr, #2 \n" // if yes, offset to THUMB instruction
|
||||
#endif
|
||||
"mov r1, #0 \n"
|
||||
"b UIE \n"
|
||||
);
|
||||
}
|
||||
|
||||
/* Unexpected Interrupt or Exception handler. Currently only deals with
|
||||
exceptions, but will deal with interrupts later.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue