diff options
author | Roberto Vargas <roberto.vargas@arm.com> | 2017-11-13 13:41:58 +0000 |
---|---|---|
committer | Roberto Vargas <roberto.vargas@arm.com> | 2018-10-16 13:38:41 +0100 |
commit | 32aee8415dac5ef71d53cacc28e25a8d312cc47b (patch) | |
tree | f2ff8a50364c5bee5dd0d78a22ea66bd8ad5d3ad /include/plat | |
parent | 0a09313ec780d2f66efcda3eb2a5d1632719bd81 (diff) | |
download | arm-trusted-firmware-32aee8415dac5ef71d53cacc28e25a8d312cc47b.tar.gz |
scmi: Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled
When HW_ASSISTED_COHERENCY is enabled we can use spinlocks
instead of using the more complex and slower bakery algorithm.
Change-Id: I9d791a70050d599241169b9160a67e57d5506564
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Diffstat (limited to 'include/plat')
-rw-r--r-- | include/plat/arm/common/plat_arm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h index d543894d7..848f4eea8 100644 --- a/include/plat/arm/common/plat_arm.h +++ b/include/plat/arm/common/plat_arm.h @@ -11,6 +11,7 @@ #include <cassert.h> #include <cpu_data.h> #include <stdint.h> +#include <spinlock.h> #include <tzc_common.h> #include <utils_def.h> @@ -80,6 +81,14 @@ void arm_setup_romlib(void); */ #define ARM_INSTANTIATE_LOCK static DEFINE_BAKERY_LOCK(arm_lock) #define ARM_LOCK_GET_INSTANCE (&arm_lock) + +#if !HW_ASSISTED_COHERENCY +#define ARM_SCMI_INSTANTIATE_LOCK DEFINE_BAKERY_LOCK(arm_scmi_lock) +#else +#define ARM_SCMI_INSTANTIATE_LOCK spinlock_t arm_scmi_lock +#endif +#define ARM_SCMI_LOCK_GET_INSTANCE (&arm_scmi_lock) + /* * These are wrapper macros to the Coherent Memory Bakery Lock API. */ |