Roberto Vargas | e0e9946 | 2017-10-30 14:43:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | #include <bl1.h> |
| 10 | #include <bl_common.h> |
| 11 | #include <context.h> |
| 12 | |
| 13 | /* ----------------------------------------------------------------------------- |
| 14 | * Very simple stackless exception handlers used by BL2. |
| 15 | * ----------------------------------------------------------------------------- |
| 16 | */ |
| 17 | .globl bl2_el3_exceptions |
| 18 | |
| 19 | vector_base bl2_el3_exceptions |
| 20 | |
| 21 | /* ----------------------------------------------------- |
| 22 | * Current EL with SP0 : 0x0 - 0x200 |
| 23 | * ----------------------------------------------------- |
| 24 | */ |
| 25 | vector_entry SynchronousExceptionSP0 |
| 26 | mov x0, #SYNC_EXCEPTION_SP_EL0 |
| 27 | bl plat_report_exception |
| 28 | no_ret plat_panic_handler |
| 29 | check_vector_size SynchronousExceptionSP0 |
| 30 | |
| 31 | vector_entry IrqSP0 |
| 32 | mov x0, #IRQ_SP_EL0 |
| 33 | bl plat_report_exception |
| 34 | no_ret plat_panic_handler |
| 35 | check_vector_size IrqSP0 |
| 36 | |
| 37 | vector_entry FiqSP0 |
| 38 | mov x0, #FIQ_SP_EL0 |
| 39 | bl plat_report_exception |
| 40 | no_ret plat_panic_handler |
| 41 | check_vector_size FiqSP0 |
| 42 | |
| 43 | vector_entry SErrorSP0 |
| 44 | mov x0, #SERROR_SP_EL0 |
| 45 | bl plat_report_exception |
| 46 | no_ret plat_panic_handler |
| 47 | check_vector_size SErrorSP0 |
| 48 | |
| 49 | /* ----------------------------------------------------- |
| 50 | * Current EL with SPx: 0x200 - 0x400 |
| 51 | * ----------------------------------------------------- |
| 52 | */ |
| 53 | vector_entry SynchronousExceptionSPx |
| 54 | mov x0, #SYNC_EXCEPTION_SP_ELX |
| 55 | bl plat_report_exception |
| 56 | no_ret plat_panic_handler |
| 57 | check_vector_size SynchronousExceptionSPx |
| 58 | |
| 59 | vector_entry IrqSPx |
| 60 | mov x0, #IRQ_SP_ELX |
| 61 | bl plat_report_exception |
| 62 | no_ret plat_panic_handler |
| 63 | check_vector_size IrqSPx |
| 64 | |
| 65 | vector_entry FiqSPx |
| 66 | mov x0, #FIQ_SP_ELX |
| 67 | bl plat_report_exception |
| 68 | no_ret plat_panic_handler |
| 69 | check_vector_size FiqSPx |
| 70 | |
| 71 | vector_entry SErrorSPx |
| 72 | mov x0, #SERROR_SP_ELX |
| 73 | bl plat_report_exception |
| 74 | no_ret plat_panic_handler |
| 75 | check_vector_size SErrorSPx |
| 76 | |
| 77 | /* ----------------------------------------------------- |
| 78 | * Lower EL using AArch64 : 0x400 - 0x600 |
| 79 | * ----------------------------------------------------- |
| 80 | */ |
| 81 | vector_entry SynchronousExceptionA64 |
| 82 | mov x0, #SYNC_EXCEPTION_AARCH64 |
| 83 | bl plat_report_exception |
| 84 | no_ret plat_panic_handler |
| 85 | check_vector_size SynchronousExceptionA64 |
| 86 | |
| 87 | vector_entry IrqA64 |
| 88 | mov x0, #IRQ_AARCH64 |
| 89 | bl plat_report_exception |
| 90 | no_ret plat_panic_handler |
| 91 | check_vector_size IrqA64 |
| 92 | |
| 93 | vector_entry FiqA64 |
| 94 | mov x0, #FIQ_AARCH64 |
| 95 | bl plat_report_exception |
| 96 | no_ret plat_panic_handler |
| 97 | check_vector_size FiqA64 |
| 98 | |
| 99 | vector_entry SErrorA64 |
| 100 | mov x0, #SERROR_AARCH64 |
| 101 | bl plat_report_exception |
| 102 | no_ret plat_panic_handler |
| 103 | check_vector_size SErrorA64 |
| 104 | |
| 105 | /* ----------------------------------------------------- |
| 106 | * Lower EL using AArch32 : 0x600 - 0x800 |
| 107 | * ----------------------------------------------------- |
| 108 | */ |
| 109 | vector_entry SynchronousExceptionA32 |
| 110 | mov x0, #SYNC_EXCEPTION_AARCH32 |
| 111 | bl plat_report_exception |
| 112 | no_ret plat_panic_handler |
| 113 | check_vector_size SynchronousExceptionA32 |
| 114 | |
| 115 | vector_entry IrqA32 |
| 116 | mov x0, #IRQ_AARCH32 |
| 117 | bl plat_report_exception |
| 118 | no_ret plat_panic_handler |
| 119 | check_vector_size IrqA32 |
| 120 | |
| 121 | vector_entry FiqA32 |
| 122 | mov x0, #FIQ_AARCH32 |
| 123 | bl plat_report_exception |
| 124 | no_ret plat_panic_handler |
| 125 | check_vector_size FiqA32 |
| 126 | |
| 127 | vector_entry SErrorA32 |
| 128 | mov x0, #SERROR_AARCH32 |
| 129 | bl plat_report_exception |
| 130 | no_ret plat_panic_handler |
| 131 | check_vector_size SErrorA32 |