diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2020-04-02 15:35:19 +0900 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2020-04-07 09:33:13 +0200 |
commit | 115041633d662ea8f2d3952f10c6e39ad5f5ef22 (patch) | |
tree | dec539002f5977beb86f2e9651c58400d6657d4f /include | |
parent | 78460ced4d7bf4aec02e11a05664eaf8684ccbc6 (diff) | |
download | trusted-firmware-a-115041633d662ea8f2d3952f10c6e39ad5f5ef22.tar.gz |
locks: bakery: use is_dcache_enabled() helper
bakery_lock_normal.c uses the raw register accessor, read_sctlr(_el3)
to check whether the dcache is enabled.
Using is_dcache_enabled() is cleaner, and a good abstraction for
the library code like this.
A problem is is_dcache_enabled() is declared in the local header,
lib/xlat_tables_v2/xlat_tables_private.h
I searched for a good place to declare this helper. Moving it to
arch_helpers.h, closed to cache operation helpers, looks good enough
to me.
I also changed the type of 'is_cached' to bool for consistency,
and to avoid MISRA warnings.
Change-Id: I9b016f67bc8eade25c316aa9c0db0fa4cd375b79
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/arch/aarch32/arch_helpers.h | 4 | ||||
-rw-r--r-- | include/arch/aarch64/arch_helpers.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/arch/aarch32/arch_helpers.h b/include/arch/aarch32/arch_helpers.h index cbac84b93a..a90b2a54cf 100644 --- a/include/arch/aarch32/arch_helpers.h +++ b/include/arch/aarch32/arch_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -8,6 +8,7 @@ #define ARCH_HELPERS_H #include <cdefs.h> +#include <stdbool.h> #include <stdint.h> #include <string.h> @@ -178,6 +179,7 @@ static inline void _op ## _type(u_register_t v) \ void flush_dcache_range(uintptr_t addr, size_t size); void clean_dcache_range(uintptr_t addr, size_t size); void inv_dcache_range(uintptr_t addr, size_t size); +bool is_dcache_enabled(void); void dcsw_op_louis(u_register_t op_type); void dcsw_op_all(u_register_t op_type); diff --git a/include/arch/aarch64/arch_helpers.h b/include/arch/aarch64/arch_helpers.h index 7c30758d00..669a1403c4 100644 --- a/include/arch/aarch64/arch_helpers.h +++ b/include/arch/aarch64/arch_helpers.h @@ -226,6 +226,7 @@ DEFINE_SYSOP_PARAM_FUNC(xpaci) void flush_dcache_range(uintptr_t addr, size_t size); void clean_dcache_range(uintptr_t addr, size_t size); void inv_dcache_range(uintptr_t addr, size_t size); +bool is_dcache_enabled(void); void dcsw_op_louis(u_register_t op_type); void dcsw_op_all(u_register_t op_type); |