Pierre-Clément Tosi | d40ff91 | 2022-06-30 16:11:33 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * The following table is intended to trap any fault resulting from the very |
| 19 | * first memory accesses. They assume that PSCI v0.2 is available and provides |
| 20 | * the PSCI_SYSTEM_RESET call in an attempt to gracefully exit but otherwise |
| 21 | * results in the core busy-looping. |
| 22 | */ |
| 23 | |
| 24 | .macro exception_panic |
| 25 | mov x0, 0x80400000 |
| 26 | add x0, x0, 9 |
| 27 | mov x1, 0 |
| 28 | mov x2, 0 |
| 29 | mov x3, 0 |
| 30 | hvc 0 |
| 31 | 0: wfi |
| 32 | b 0b |
| 33 | .endm |
| 34 | |
| 35 | .section .text.vector_table_panic, "ax" |
| 36 | .global vector_table_panic |
| 37 | .balign 0x800 |
| 38 | vector_table_panic: |
| 39 | sync_cur_sp0_panic: |
| 40 | exception_panic |
| 41 | |
| 42 | .balign 0x80 |
| 43 | irq_cur_sp0_panic: |
| 44 | exception_panic |
| 45 | |
| 46 | .balign 0x80 |
| 47 | fiq_cur_sp0_panic: |
| 48 | exception_panic |
| 49 | |
| 50 | .balign 0x80 |
| 51 | serr_cur_sp0_panic: |
| 52 | exception_panic |
| 53 | |
| 54 | .balign 0x80 |
| 55 | sync_cur_spx_panic: |
| 56 | exception_panic |
| 57 | |
| 58 | .balign 0x80 |
| 59 | irq_cur_spx_panic: |
| 60 | exception_panic |
| 61 | |
| 62 | .balign 0x80 |
| 63 | fiq_cur_spx_panic: |
| 64 | exception_panic |
| 65 | |
| 66 | .balign 0x80 |
| 67 | serr_cur_spx_panic: |
| 68 | exception_panic |
| 69 | |
| 70 | .balign 0x80 |
| 71 | sync_lower_64_panic: |
| 72 | exception_panic |
| 73 | |
| 74 | .balign 0x80 |
| 75 | irq_lower_64_panic: |
| 76 | exception_panic |
| 77 | |
| 78 | .balign 0x80 |
| 79 | fiq_lower_64_panic: |
| 80 | exception_panic |
| 81 | |
| 82 | .balign 0x80 |
| 83 | serr_lower_64_panic: |
| 84 | exception_panic |
| 85 | |
| 86 | .balign 0x80 |
| 87 | sync_lower_32_panic: |
| 88 | exception_panic |
| 89 | |
| 90 | .balign 0x80 |
| 91 | irq_lower_32_panic: |
| 92 | exception_panic |
| 93 | |
| 94 | .balign 0x80 |
| 95 | fiq_lower_32_panic: |
| 96 | exception_panic |
| 97 | |
| 98 | .balign 0x80 |
| 99 | serr_lower_32_panic: |
| 100 | exception_panic |