summaryrefslogtreecommitdiff
path: root/tftf
diff options
context:
space:
mode:
authorDeepika Bhavnani <deepika.bhavnani@arm.com>2020-02-06 16:29:45 -0600
committerDeepika Bhavnani <deepika.bhavnani@arm.com>2020-02-11 09:22:12 -0600
commitc249d5e5cfbf2aa0f584001543c1d39953e1d6aa (patch)
treebae825efb76949c451188bb0e96de2ea1b120514 /tftf
parent1b5952a79ca1a6feb7b23372420285e886497852 (diff)
Switch AARCH32/AARCH64 to __aarch64__
NOTE: AARCH32/AARCH64 macros are now deprecated in favor of __aarch64__. All common C compilers pre-define the same macros to signal which architecture the code is being compiled for: __arm__ for AArch32 (or earlier versions) and __aarch64__ for AArch64. There's no need for TF-A to define its own custom macros for this. In order to unify code with the export headers (which use __aarch64__ to avoid another dependency), let's deprecate the AARCH32 and AARCH64 macros and switch the code base over to the pre-defined standard macro. (Since it is somewhat unintuitive that __arm__ only means AArch32, let's standardize on only using __aarch64__.) NOTE: This change is based on below TFA commit https://github.com/ARM-software/arm-trusted-firmware/commit/402b3cf8766fe2cb4ae462f7ee7761d08a1ba56c Signed-off-by: Deepika Bhavnani <deepika.bhavnani@arm.com> Change-Id: If2c3dbaeb01d4a9d8cfd95d906e5eaf4ae94417f
Diffstat (limited to 'tftf')
-rw-r--r--tftf/framework/main.c4
-rw-r--r--tftf/tests/extensions/mte/test_mte.c10
-rw-r--r--tftf/tests/extensions/sve/sve_operations.S6
-rw-r--r--tftf/tests/misc_tests/inject_serror.S4
-rw-r--r--tftf/tests/misc_tests/test_pmu_leakage.c4
-rw-r--r--tftf/tests/misc_tests/test_single_fault.c4
-rw-r--r--tftf/tests/misc_tests/test_uncontainable.c4
-rw-r--r--tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_1.c4
-rw-r--r--tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_2.c6
-rw-r--r--tftf/tests/runtime_services/generic/generic_smc.c8
-rw-r--r--tftf/tests/runtime_services/sip_service/test_exec_state_switch.c14
-rw-r--r--tftf/tests/runtime_services/sip_service/test_exec_state_switch_asm.S8
-rw-r--r--tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c4
-rw-r--r--tftf/tests/runtime_services/standard_service/sdei/system_tests/sdei_entrypoint.S4
-rw-r--r--tftf/tests/xlat_lib_v2/xlat_lib_v2_tests.c8
15 files changed, 46 insertions, 46 deletions
diff --git a/tftf/framework/main.c b/tftf/framework/main.c
index 2523a97..2350b96 100644
--- a/tftf/framework/main.c
+++ b/tftf/framework/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -517,7 +517,7 @@ void __dead2 tftf_cold_boot_main(void)
NOTICE("%s\n", build_message);
NOTICE("%s\n\n", version_string);
-#ifndef AARCH32
+#ifdef __aarch64__
NOTICE("Running at NS-EL%u\n", IS_IN_EL(1) ? 1 : 2);
#else
NOTICE("Running in AArch32 HYP mode\n");
diff --git a/tftf/tests/extensions/mte/test_mte.c b/tftf/tests/extensions/mte/test_mte.c
index 13da667..7dbb9ef 100644
--- a/tftf/tests/extensions/mte/test_mte.c
+++ b/tftf/tests/extensions/mte/test_mte.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -12,7 +12,7 @@
test_result_t test_mte_instructions(void)
{
SKIP_TEST_IF_AARCH32();
-#ifdef AARCH64
+#ifdef __aarch64__
SKIP_TEST_IF_MTE_SUPPORT_LESS_THAN(MTE_IMPLEMENTED_EL0);
/* irg */
@@ -24,13 +24,13 @@ test_result_t test_mte_instructions(void)
__asm__ volatile (".inst 0xD1800129");
return TEST_RESULT_SUCCESS;
-#endif /* AARCH64 */
+#endif /* __aarch64__ */
}
test_result_t test_mte_leakage(void)
{
SKIP_TEST_IF_AARCH32();
-#ifdef AARCH64
+#ifdef __aarch64__
smc_args tsp_svc_params;
int gcr_el1;
@@ -53,5 +53,5 @@ test_result_t test_mte_leakage(void)
}
return TEST_RESULT_SUCCESS;
-#endif /* AARCH64 */
+#endif /* __aarch64__ */
}
diff --git a/tftf/tests/extensions/sve/sve_operations.S b/tftf/tests/extensions/sve/sve_operations.S
index 9440b13..e528b2b 100644
--- a/tftf/tests/extensions/sve/sve_operations.S
+++ b/tftf/tests/extensions/sve/sve_operations.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,7 +8,7 @@
#include "./test_sve.h"
-#ifdef AARCH64
+#ifdef __aarch64__
#if __GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ > 0)
/*
@@ -36,4 +36,4 @@ func sve_subtract_arrays
endfunc sve_subtract_arrays
#endif /* __GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ > 0) */
-#endif /* AARCH64 */
+#endif /* __aarch64__ */
diff --git a/tftf/tests/misc_tests/inject_serror.S b/tftf/tests/misc_tests/inject_serror.S
index 0d7dbf2..008503f 100644
--- a/tftf/tests/misc_tests/inject_serror.S
+++ b/tftf/tests/misc_tests/inject_serror.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -9,7 +9,7 @@
#include <sdei.h>
-#ifdef AARCH64
+#ifdef __aarch64__
.globl inject_serror
.globl inject_uncontainable
.globl serror_sdei_event_handler
diff --git a/tftf/tests/misc_tests/test_pmu_leakage.c b/tftf/tests/misc_tests/test_pmu_leakage.c
index da28999..36b3138 100644
--- a/tftf/tests/misc_tests/test_pmu_leakage.c
+++ b/tftf/tests/misc_tests/test_pmu_leakage.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -75,7 +75,7 @@ struct pmu_event_info {
unsigned long long avg;
};
-#ifdef AARCH64
+#ifdef __aarch64__
#define V8_2_DEBUG_ARCH_SUPPORTED ID_AA64DFR0_V8_2_DEBUG_ARCH_SUPPORTED
#else
#define V8_2_DEBUG_ARCH_SUPPORTED DBGDIDR_V8_2_DEBUG_ARCH_SUPPORTED
diff --git a/tftf/tests/misc_tests/test_single_fault.c b/tftf/tests/misc_tests/test_single_fault.c
index e652211..f55d8de 100644
--- a/tftf/tests/misc_tests/test_single_fault.c
+++ b/tftf/tests/misc_tests/test_single_fault.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -9,7 +9,7 @@
#include <sdei.h>
#include <tftf_lib.h>
-#ifndef AARCH32
+#ifdef __aarch64__
uint64_t serror_received;
diff --git a/tftf/tests/misc_tests/test_uncontainable.c b/tftf/tests/misc_tests/test_uncontainable.c
index 79c9031..231e5e8 100644
--- a/tftf/tests/misc_tests/test_uncontainable.c
+++ b/tftf/tests/misc_tests/test_uncontainable.c
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <tftf_lib.h>
-#ifndef AARCH32
+#ifdef __aarch64__
extern void inject_uncontainable(void);
diff --git a/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_1.c b/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_1.c
index 90a43f3..e88f183 100644
--- a/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_1.c
+++ b/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_1.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -14,7 +14,7 @@
#include <string.h>
#include <tftf_lib.h>
-#ifdef AARCH64
+#ifdef __aarch64__
#define CORTEX_A57_MIDR 0x410FD070
#define CORTEX_A72_MIDR 0x410FD080
#define CORTEX_A73_MIDR 0x410FD090
diff --git a/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_2.c b/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_2.c
index cf36e4f..1557e4f 100644
--- a/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_2.c
+++ b/tftf/tests/runtime_services/arm_arch_svc/smccc_arch_workaround_2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -14,7 +14,7 @@
#include <string.h>
#include <tftf_lib.h>
-#ifdef AARCH64
+#ifdef __aarch64__
#define NOT_REQUIRED_DONOT_INVOKE -2
#define NOT_SUPPORTED -1
#define IS_REQUIRED 0
@@ -159,4 +159,4 @@ test_result_t test_smccc_arch_workaround_2(void)
INFO("%s skipped on AArch32\n", __func__);
return TEST_RESULT_SKIPPED;
}
-#endif /* AARCH64 */
+#endif /* __aarch64__ */
diff --git a/tftf/tests/runtime_services/generic/generic_smc.c b/tftf/tests/runtime_services/generic/generic_smc.c
index dc0b102..6d057a6 100644
--- a/tftf/tests/runtime_services/generic/generic_smc.c
+++ b/tftf/tests/runtime_services/generic/generic_smc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -236,7 +236,7 @@ test_result_t smc64_yielding(void)
return TEST_RESULT_SUCCESS;
}
-#ifdef AARCH32
+#ifndef __aarch64__
static test_result_t smc64_fast_caller32(void)
{
/* Valid Fast SMC32 using all 4 return values. */
@@ -295,12 +295,12 @@ static test_result_t smc64_fast_caller64(void)
return TEST_RESULT_SUCCESS;
}
-#endif /* AARCH32 */
+#endif /* !__aarch64__ */
/* Exercise SMC64 calling convention with fast SMC calls. */
test_result_t smc64_fast(void)
{
-#ifdef AARCH32
+#ifndef __aarch64__
return smc64_fast_caller32();
#else
return smc64_fast_caller64();
diff --git a/tftf/tests/runtime_services/sip_service/test_exec_state_switch.c b/tftf/tests/runtime_services/sip_service/test_exec_state_switch.c
index 713c819..9b272ba 100644
--- a/tftf/tests/runtime_services/sip_service/test_exec_state_switch.c
+++ b/tftf/tests/runtime_services/sip_service/test_exec_state_switch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -65,7 +65,7 @@ extern int do_state_switch(void *);
*/
test_result_t test_exec_state_switch_reset_before(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
int version;
smc_args sip_version_smc = { ARM_SIP_SVC_VERSION };
smc_args reset = { SMC_PSCI_SYSTEM_RESET };
@@ -126,7 +126,7 @@ test_result_t test_exec_state_switch_reset_before(void)
*/
test_result_t test_exec_state_switch_invalid_pc(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
int ret;
smc_args args = {
@@ -159,7 +159,7 @@ test_result_t test_exec_state_switch_invalid_pc(void)
*/
test_result_t test_exec_state_switch_invalid_ctx(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
int ret;
smc_args args = {
@@ -191,7 +191,7 @@ test_result_t test_exec_state_switch_invalid_ctx(void)
*/
test_result_t test_exec_state_switch_valid(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
int ret;
smc_args args = {
@@ -233,7 +233,7 @@ test_result_t test_exec_state_switch_valid(void)
*/
static inline test_result_t cpu_ping(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
/* Tell the lead CPU that the calling CPU has entered the test */
tftf_send_event(&secondary_booted);
@@ -254,7 +254,7 @@ static inline test_result_t cpu_ping(void)
*/
test_result_t test_exec_state_switch_after_cpu_on(void)
{
-#ifdef AARCH64
+#ifdef __aarch64__
u_register_t other_mpidr, my_mpidr;
int ret;
diff --git a/tftf/tests/runtime_services/sip_service/test_exec_state_switch_asm.S b/tftf/tests/runtime_services/sip_service/test_exec_state_switch_asm.S
index 577f89f..d865756 100644
--- a/tftf/tests/runtime_services/sip_service/test_exec_state_switch_asm.S
+++ b/tftf/tests/runtime_services/sip_service/test_exec_state_switch_asm.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,7 +8,7 @@
#define COOKIE_SIZE 20
-#ifdef AARCH64
+#ifdef __aarch64__
/* int do_state_switch(void *) */
.globl do_state_switch
func do_state_switch
@@ -167,7 +167,7 @@ state_switch_a32_entry:
.word 0xe1600070 /* smc #0x0 */
.word 0xeafffffe /* b . */
-#else /* !AARCH64 */
+#else /* !__aarch64__ */
/* Not supported on AArch32 yet */
func do_state_switch
@@ -175,4 +175,4 @@ func do_state_switch
bx lr
endfunc do_state_switch
-#endif /* AARCH64 */
+#endif /* __aarch64__ */
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
index cc4ad19..708ea13 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -293,7 +293,7 @@ test_result_t test_affinity_info_level2(void)
*/
test_result_t test_affinity_info_level3(void)
{
-#ifndef AARCH32
+#ifdef __aarch64__
int expected_values[3];
uint64_t target_mpid;
int32_t aff_info;
diff --git a/tftf/tests/runtime_services/standard_service/sdei/system_tests/sdei_entrypoint.S b/tftf/tests/runtime_services/standard_service/sdei/system_tests/sdei_entrypoint.S
index 27ffa39..655bb24 100644
--- a/tftf/tests/runtime_services/standard_service/sdei/system_tests/sdei_entrypoint.S
+++ b/tftf/tests/runtime_services/standard_service/sdei/system_tests/sdei_entrypoint.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,7 +16,7 @@
.local event_handled
.comm event_handled, PLATFORM_CORE_COUNT * 4, 8
-#ifdef AARCH64
+#ifdef __aarch64__
func sdei_entrypoint
stp xzr, x30, [sp, #-16]!
bl sdei_event_handler
diff --git a/tftf/tests/xlat_lib_v2/xlat_lib_v2_tests.c b/tftf/tests/xlat_lib_v2/xlat_lib_v2_tests.c
index a62bb91..519ff16 100644
--- a/tftf/tests/xlat_lib_v2/xlat_lib_v2_tests.c
+++ b/tftf/tests/xlat_lib_v2/xlat_lib_v2_tests.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -67,7 +67,7 @@ static unsigned long long va2pa(uintptr_t base_va)
* Performs stage 1 address translation for the current EL, with
* read permissions.
*/
-#ifdef AARCH32
+#ifndef __aarch64__
if (IS_IN_HYP())
write_ats1hr(base_va);
else
@@ -497,7 +497,7 @@ test_result_t xlat_lib_v2_basic_test(void)
return TEST_RESULT_FAIL;
}
-#if AARCH64
+#ifdef __aarch64__
unsigned long long memory_base_pa;
/*
@@ -644,7 +644,7 @@ test_result_t xlat_lib_v2_alignment_test(void)
return TEST_RESULT_FAIL;
}
-#if AARCH64
+#ifdef __aarch64__
/*
* 3) Try to allocate at least 1 GB aligned. There is only room for this
* in AArch64.