summaryrefslogtreecommitdiff
path: root/include/lib
diff options
context:
space:
mode:
authorJayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>2023-03-06 23:56:14 +0000
committerManish V Badarkhe <manish.badarkhe@arm.com>2023-03-28 17:19:07 +0200
commit45007acd46981b9f289f03b283eb53e7ba37bb67 (patch)
treedf4d289c742923fcb05a61d7fa85400272b7873d /include/lib
parentcfe6a82ee87ff178e05f542f65549520cf764956 (diff)
downloadarm-trusted-firmware-45007acd46981b9f289f03b283eb53e7ba37bb67.tar.gz
feat(cpufeat): enable FEAT_SME for FEAT_STATE_CHECKED
Add support for runtime detection (ENABLE_SME_FOR_NS=2), by splitting feat_sme_supported() into an ID register reading function and a second function to report the support status. That function considers both build time settings and runtime information (if needed), and is used before we do SME specific setup. Change the FVP platform default to the now supported dynamic option (=2),so the right decision can be made by the code at runtime. Change-Id: Ida9ccf737db5be20865b84f42b1f9587be0626ab Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/extensions/sme.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/lib/extensions/sme.h b/include/lib/extensions/sme.h
index 893f9f2cb..0e9c4b923 100644
--- a/include/lib/extensions/sme.h
+++ b/include/lib/extensions/sme.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,7 +8,6 @@
#define SME_H
#include <stdbool.h>
-
#include <context.h>
/*
@@ -21,7 +20,16 @@
*/
#define SME_SMCR_LEN_MAX U(0x1FF)
+#if ENABLE_SME_FOR_NS
void sme_enable(cpu_context_t *context);
void sme_disable(cpu_context_t *context);
+#else
+static inline void sme_enable(cpu_context_t *context)
+{
+}
+static inline void sme_disable(cpu_context_t *context)
+{
+}
+#endif /* ENABLE_SME_FOR_NS */
#endif /* SME_H */