diff options
author | Dimitris Papastamos <dimitris.papastamos@arm.com> | 2018-07-11 11:13:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 11:13:36 +0100 |
commit | 9a93d8ccff0abe225bfabbed7970075640f90de4 (patch) | |
tree | 012ea8874fdad102385555faf820562347c402e8 /include | |
parent | 89a793425b52c7f563eb07984fd79198471ce61c (diff) | |
parent | 4a98f0ef4c135ce7e1016a3c0fa3d75b6a54630b (diff) |
Merge pull request #1460 from robertovargas-arm/clang
Make TF compatible with Clang assembler and linker
Diffstat (limited to 'include')
-rw-r--r-- | include/common/aarch64/asm_macros.S | 20 | ||||
-rw-r--r-- | include/common/asm_macros_common.S | 4 | ||||
-rw-r--r-- | include/lib/cpus/aarch32/cpu_macros.S | 74 | ||||
-rw-r--r-- | include/lib/cpus/aarch64/cpu_macros.S | 89 | ||||
-rw-r--r-- | include/plat/arm/common/aarch64/arm_macros.S | 3 | ||||
-rw-r--r-- | include/plat/arm/common/arm_common.ld.S | 4 |
6 files changed, 96 insertions, 98 deletions
diff --git a/include/common/aarch64/asm_macros.S b/include/common/aarch64/asm_macros.S index 5b050455..6e66ea99 100644 --- a/include/common/aarch64/asm_macros.S +++ b/include/common/aarch64/asm_macros.S @@ -83,23 +83,31 @@ .section \section_name, "ax" .align 7, 0 .type \label, %function - .func \label .cfi_startproc \label: .endm /* + * Add the bytes until fill the full exception vector, whose size is always + * 32 instructions. If there are more than 32 instructions in the + * exception vector then an error is emitted. + */ + .macro end_vector_entry label + .cfi_endproc + .fill \label + (32 * 4) - . + .endm + + /* * This macro verifies that the given vector doesn't exceed the * architectural limit of 32 instructions. This is meant to be placed * immediately after the last instruction in the vector. It takes the * vector entry as the parameter */ .macro check_vector_size since - .endfunc - .cfi_endproc - .if (. - \since) > (32 * 4) - .error "Vector exceeds 32 instructions" - .endif +#if ERROR_DEPRECATED + .error "check_vector_size must not be used. Use end_vector_entry instead" +#endif + end_vector_entry \since .endm #if ENABLE_PLAT_COMPAT diff --git a/include/common/asm_macros_common.S b/include/common/asm_macros_common.S index ca8c1ad0..081addcc 100644 --- a/include/common/asm_macros_common.S +++ b/include/common/asm_macros_common.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -31,7 +31,6 @@ .cfi_sections .debug_frame .section .text.asm.\_name, "ax" .type \_name, %function - .func \_name /* * .cfi_startproc and .cfi_endproc are needed to output entries in * .debug_frame @@ -45,7 +44,6 @@ * This macro is used to mark the end of a function. */ .macro endfunc _name - .endfunc .cfi_endproc .size \_name, . - \_name .endm diff --git a/include/lib/cpus/aarch32/cpu_macros.S b/include/lib/cpus/aarch32/cpu_macros.S index 0f3a5728..7703be33 100644 --- a/include/lib/cpus/aarch32/cpu_macros.S +++ b/include/lib/cpus/aarch32/cpu_macros.S @@ -35,38 +35,47 @@ # define REPORT_ERRATA 0 #endif - /* - * Define the offsets to the fields in cpu_ops structure. - */ - .struct 0 -CPU_MIDR: /* cpu_ops midr */ - .space 4 -/* Reset fn is needed during reset */ -#if defined(IMAGE_AT_EL3) -CPU_RESET_FUNC: /* cpu_ops reset_func */ - .space 4 + + .equ CPU_MIDR_SIZE, CPU_WORD_SIZE + .equ CPU_RESET_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_PWR_DWN_OPS_SIZE, CPU_WORD_SIZE * CPU_MAX_PWR_DWN_OPS + .equ CPU_ERRATA_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_ERRATA_LOCK_SIZE, CPU_WORD_SIZE + .equ CPU_ERRATA_PRINTED_SIZE, CPU_WORD_SIZE + +#ifndef IMAGE_AT_EL3 + .equ CPU_RESET_FUNC_SIZE, 0 #endif -#ifdef IMAGE_BL32 /* The power down core and cluster is needed only in BL32 */ -CPU_PWR_DWN_OPS: /* cpu_ops power down functions */ - .space (4 * CPU_MAX_PWR_DWN_OPS) + +/* The power down core and cluster is needed only in BL32 */ +#ifndef IMAGE_BL32 + .equ CPU_PWR_DWN_OPS_SIZE, 0 #endif -/* - * Fields required to print errata status. Only in BL32 that the printing - * require mutual exclusion and printed flag. - */ -#if REPORT_ERRATA -CPU_ERRATA_FUNC: /* CPU errata status printing function */ - .space 4 -#if defined(IMAGE_BL32) -CPU_ERRATA_LOCK: - .space 4 -CPU_ERRATA_PRINTED: - .space 4 +/* Fields required to print errata status */ +#if !REPORT_ERRATA + .equ CPU_ERRATA_FUNC_SIZE, 0 #endif + +/* Only BL32 requires mutual exclusion and printed flag. */ +#if !(REPORT_ERRATA && defined(IMAGE_BL32)) + .equ CPU_ERRATA_LOCK_SIZE, 0 + .equ CPU_ERRATA_PRINTED_SIZE, 0 #endif -CPU_OPS_SIZE = . + +/* + * Define the offsets to the fields in cpu_ops structure. + * Every offset is defined based on the offset and size of the previous + * field. + */ + .equ CPU_MIDR, 0 + .equ CPU_RESET_FUNC, CPU_MIDR + CPU_MIDR_SIZE + .equ CPU_PWR_DWN_OPS, CPU_RESET_FUNC + CPU_RESET_FUNC_SIZE + .equ CPU_ERRATA_FUNC, CPU_PWR_DWN_OPS + CPU_PWR_DWN_OPS_SIZE + .equ CPU_ERRATA_LOCK, CPU_ERRATA_FUNC + CPU_ERRATA_FUNC_SIZE + .equ CPU_ERRATA_PRINTED, CPU_ERRATA_LOCK + CPU_ERRATA_LOCK_SIZE + .equ CPU_OPS_SIZE, CPU_ERRATA_PRINTED + CPU_ERRATA_PRINTED_SIZE /* * Write given expressions as words @@ -128,21 +137,8 @@ CPU_OPS_SIZE = . .word \_resetfunc #endif #ifdef IMAGE_BL32 -1: /* Insert list of functions */ fill_constants CPU_MAX_PWR_DWN_OPS, \_power_down_ops -2: - /* - * Error if no or more than CPU_MAX_PWR_DWN_OPS were specified in the - * list - */ - .ifeq 2b - 1b - .error "At least one power down function must be specified" - .else - .iflt 2b - 1b - (CPU_MAX_PWR_DWN_OPS * CPU_WORD_SIZE) - .error "More than CPU_MAX_PWR_DWN_OPS functions specified" - .endif - .endif #endif #if REPORT_ERRATA diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S index cd8f3e8f..026a48e3 100644 --- a/include/lib/cpus/aarch64/cpu_macros.S +++ b/include/lib/cpus/aarch64/cpu_macros.S @@ -38,46 +38,56 @@ # define REPORT_ERRATA 0 #endif - /* - * Define the offsets to the fields in cpu_ops structure. - */ - .struct 0 -CPU_MIDR: /* cpu_ops midr */ - .space 8 -/* Reset fn is needed in BL at reset vector */ -#if defined(IMAGE_AT_EL3) -CPU_RESET_FUNC: /* cpu_ops reset_func */ - .space 8 + + .equ CPU_MIDR_SIZE, CPU_WORD_SIZE + .equ CPU_EXTRA1_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_EXTRA2_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_RESET_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_PWR_DWN_OPS_SIZE, CPU_WORD_SIZE * CPU_MAX_PWR_DWN_OPS + .equ CPU_ERRATA_FUNC_SIZE, CPU_WORD_SIZE + .equ CPU_ERRATA_LOCK_SIZE, CPU_WORD_SIZE + .equ CPU_ERRATA_PRINTED_SIZE, CPU_WORD_SIZE + .equ CPU_REG_DUMP_SIZE, CPU_WORD_SIZE + +#ifndef IMAGE_AT_EL3 + .equ CPU_RESET_FUNC_SIZE, 0 #endif -CPU_EXTRA1_FUNC: - .space 8 -CPU_EXTRA2_FUNC: - .space 8 -#ifdef IMAGE_BL31 /* The power down core and cluster is needed only in BL31 */ -CPU_PWR_DWN_OPS: /* cpu_ops power down functions */ - .space (8 * CPU_MAX_PWR_DWN_OPS) + +/* The power down core and cluster is needed only in BL31 */ +#ifndef IMAGE_BL31 + .equ CPU_PWR_DWN_OPS_SIZE, 0 #endif -/* - * Fields required to print errata status. Only in BL31 that the printing - * require mutual exclusion and printed flag. - */ -#if REPORT_ERRATA -CPU_ERRATA_FUNC: - .space 8 -#if defined(IMAGE_BL31) -CPU_ERRATA_LOCK: - .space 8 -CPU_ERRATA_PRINTED: - .space 8 +/* Fields required to print errata status. */ +#if !REPORT_ERRATA + .equ CPU_ERRATA_FUNC_SIZE, 0 #endif + +/* Only BL31 requieres mutual exclusion and printed flag. */ +#if !(REPORT_ERRATA && defined(IMAGE_BL31)) + .equ CPU_ERRATA_LOCK_SIZE, 0 + .equ CPU_ERRATA_PRINTED_SIZE, 0 #endif -#if defined(IMAGE_BL31) && CRASH_REPORTING -CPU_REG_DUMP: /* cpu specific register dump for crash reporting */ - .space 8 +#if !defined(IMAGE_BL31) || !CRASH_REPORTING + .equ CPU_REG_DUMP_SIZE, 0 #endif -CPU_OPS_SIZE = . + +/* + * Define the offsets to the fields in cpu_ops structure. + * Every offset is defined based in the offset and size of the previous + * field. + */ + .equ CPU_MIDR, 0 + .equ CPU_RESET_FUNC, CPU_MIDR + CPU_MIDR_SIZE + .equ CPU_EXTRA1_FUNC, CPU_RESET_FUNC + CPU_RESET_FUNC_SIZE + .equ CPU_EXTRA2_FUNC, CPU_EXTRA1_FUNC + CPU_EXTRA1_FUNC_SIZE + .equ CPU_PWR_DWN_OPS, CPU_EXTRA2_FUNC + CPU_EXTRA2_FUNC_SIZE + .equ CPU_ERRATA_FUNC, CPU_PWR_DWN_OPS + CPU_PWR_DWN_OPS_SIZE + .equ CPU_ERRATA_LOCK, CPU_ERRATA_FUNC + CPU_ERRATA_FUNC_SIZE + .equ CPU_ERRATA_PRINTED, CPU_ERRATA_LOCK + CPU_ERRATA_LOCK_SIZE + .equ CPU_REG_DUMP, CPU_ERRATA_PRINTED + CPU_ERRATA_PRINTED_SIZE + .equ CPU_OPS_SIZE, CPU_REG_DUMP + CPU_REG_DUMP_SIZE /* * Write given expressions as quad words @@ -149,21 +159,8 @@ CPU_OPS_SIZE = . .quad \_extra1 .quad \_extra2 #ifdef IMAGE_BL31 -1: /* Insert list of functions */ fill_constants CPU_MAX_PWR_DWN_OPS, \_power_down_ops -2: - /* - * Error if no or more than CPU_MAX_PWR_DWN_OPS were specified in the - * list - */ - .ifeq 2b - 1b - .error "At least one power down function must be specified" - .else - .iflt 2b - 1b - (CPU_MAX_PWR_DWN_OPS * CPU_WORD_SIZE) - .error "More than CPU_MAX_PWR_DWN_OPS functions specified" - .endif - .endif #endif #if REPORT_ERRATA diff --git a/include/plat/arm/common/aarch64/arm_macros.S b/include/plat/arm/common/aarch64/arm_macros.S index 12bf734b..7953d7e2 100644 --- a/include/plat/arm/common/aarch64/arm_macros.S +++ b/include/plat/arm/common/aarch64/arm_macros.S @@ -22,8 +22,7 @@ icc_regs: /* Registers common to both GICv2 and GICv3 */ gicd_pend_reg: - .asciz "gicd_ispendr regs (Offsets 0x200 - 0x278)\n" \ - " Offset:\t\t\tvalue\n" + .asciz "gicd_ispendr regs (Offsets 0x200 - 0x278)\n Offset:\t\t\tvalue\n" newline: .asciz "\n" spacer: diff --git a/include/plat/arm/common/arm_common.ld.S b/include/plat/arm/common/arm_common.ld.S index 6edfa099..3f6e29b0 100644 --- a/include/plat/arm/common/arm_common.ld.S +++ b/include/plat/arm/common/arm_common.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -22,7 +22,7 @@ SECTIONS *(arm_el3_tzc_dram) __EL3_SEC_DRAM_UNALIGNED_END__ = .; - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __EL3_SEC_DRAM_END__ = .; } >EL3_SEC_DRAM } |