This repository has been archived by the owner on Apr 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3: Log lr when a fault handler is executed
- Loading branch information
1 parent
7e4728d
commit c465393
Showing
3 changed files
with
68 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2016 Swift Navigation Inc. | ||
* Contact: Jacob McNamee <[email protected]> | ||
* | ||
* This source is subject to the license found in the file 'LICENSE' which must | ||
* be be distributed together with this source. All other rights reserved. | ||
* | ||
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
*/ | ||
|
||
.macro handler str | ||
/* R1 = LR */ | ||
mov r1, lr | ||
/* Switch to SYS mode with IRQs masked */ | ||
msr CPSR_c, #0x9F | ||
/* R0 = str */ | ||
ldr r0, =\str | ||
/* fault_handler_screaming_death(str, lr); */ | ||
blx fault_handler_screaming_death | ||
.endm | ||
|
||
.data | ||
|
||
und_handler_str: | ||
.asciz "Undefined instruction!" | ||
prefetch_handler_str: | ||
.asciz "Prefetch Handler!" | ||
abort_handler_str: | ||
.asciz "Abort Handler!" | ||
swi_handler_str: | ||
.asciz "Software Interrupt!" | ||
fiq_handler_str: | ||
.asciz "Unused FIQ!" | ||
|
||
.text | ||
.code 32 | ||
.balign 4 | ||
|
||
.global Und_Handler | ||
Und_Handler: | ||
handler und_handler_str | ||
|
||
.global Prefetch_Handler | ||
Prefetch_Handler: | ||
handler prefetch_handler_str | ||
|
||
.global Abort_Handler | ||
Abort_Handler: | ||
handler abort_handler_str | ||
|
||
.global Swi_Handler | ||
Swi_Handler: | ||
handler swi_handler_str | ||
|
||
.global Fiq_Handler | ||
Fiq_Handler: | ||
handler fiq_handler_str | ||
|
||
.end |