diff options
author | danh-arm <dan.handley@arm.com> | 2016-05-27 11:11:47 +0100 |
---|---|---|
committer | danh-arm <dan.handley@arm.com> | 2016-05-27 11:11:47 +0100 |
commit | aa037ca9a0b3ae52e1df5bfb4ddf273215b75877 (patch) | |
tree | e64b694999a9a2e29e544c69cc0a026c3deb87af /include/common/asm_macros.S | |
parent | 2ff900f28df5f975e1c1746e59610df5ccabf7aa (diff) | |
parent | 79627dc37259781e578c47e1e63856dd0424b2a2 (diff) |
Merge pull request #634 from sandrine-bailleux-arm/sb/exception-vectors
Improve robustness and readability of exception code
Diffstat (limited to 'include/common/asm_macros.S')
-rw-r--r-- | include/common/asm_macros.S | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/common/asm_macros.S b/include/common/asm_macros.S index a331c051..d4bd11ee 100644 --- a/include/common/asm_macros.S +++ b/include/common/asm_macros.S @@ -66,11 +66,36 @@ b.ne $label .endm + /* + * Declare the exception vector table, enforcing it is aligned on a + * 2KB boundary, as required by the ARMv8 architecture. + * Use zero bytes as the fill value to be stored in the padding bytes + * so that it inserts illegal AArch64 instructions. This increases + * security, robustness and potentially facilitates debugging. + */ + .macro vector_base label + .section .vectors, "ax" + .align 11, 0 + \label: + .endm + + /* + * Create an entry in the exception vector table, enforcing it is + * aligned on a 128-byte boundary, as required by the ARMv8 architecture. + * Use zero bytes as the fill value to be stored in the padding bytes + * so that it inserts illegal AArch64 instructions. This increases + * security, robustness and potentially facilitates debugging. + */ + .macro vector_entry label + .section .vectors, "ax" + .align 7, 0 + \label: + .endm /* - * This macro verifies that the a given vector doesn't exceed the + * This macro verifies that the given vector doesn't exceed the * architectural limit of 32 instructions. This is meant to be placed - * immedately after the last instruction in the vector. It takes the + * immediately after the last instruction in the vector. It takes the * vector entry as the parameter */ .macro check_vector_size since |