SPMD: code/comments cleanup
As a follow-up to bdd2596d4, and related to SPM Dispatcher
EL3 component and SPM Core S-EL2/S-EL1 component: update
with cosmetic and coding rules changes. In addition:
-Add Armv8.4-SecEL2 arch detection helper.
-Add an SPMC context (on current core) get helper.
-Return more meaningful error return codes.
-Remove complexity in few spmd_smc_handler switch-cases.
-Remove unused defines and structures from spmd_private.h
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I99e642450b0dafb19d3218a2f0e2d3107e8ca3fe
diff --git a/include/arch/aarch64/arch_features.h b/include/arch/aarch64/arch_features.h
index 0491f48..9513e97 100644
--- a/include/arch/aarch64/arch_features.h
+++ b/include/arch/aarch64/arch_features.h
@@ -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
*/
@@ -52,4 +52,10 @@
ID_AA64PFR1_EL1_MTE_MASK);
}
+static inline bool is_armv8_4_sel2_present(void)
+{
+ return ((read_id_aa64pfr0_el1() >> ID_AA64PFR0_SEL2_SHIFT) &
+ ID_AA64PFR0_SEL2_MASK) == 1ULL;
+}
+
#endif /* ARCH_FEATURES_H */
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index e4431d2..946a3b8 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -289,7 +289,7 @@
int plat_spm_sp_get_next_address(void **sp_base, size_t *sp_size,
void **rd_base, size_t *rd_size);
#if defined(SPD_spmd)
-int plat_spm_core_manifest_load(spmc_manifest_sect_attribute_t *manifest,
+int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest,
const void *ptr,
size_t size);
#endif
diff --git a/include/services/spm_core_manifest.h b/include/services/spm_core_manifest.h
index 71e6cfb..0c43636 100644
--- a/include/services/spm_core_manifest.h
+++ b/include/services/spm_core_manifest.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef SPMC_MANIFEST_H
-#define SPMC_MANIFEST_H
+#ifndef SPM_CORE_MANIFEST_H
+#define SPM_CORE_MANIFEST_H
#include <stdint.h>
@@ -28,18 +28,18 @@
uint32_t exec_state;
/*
- * Address of binary image containing SPM core in bytes (optional).
+ * Address of binary image containing SPM Core (optional).
*/
uint64_t load_address;
/*
* Offset from the base of the partition's binary image to the entry
- * point of the partition.
+ * point of the partition (optional).
*/
uint64_t entrypoint;
/*
- * Size of binary image containing SPM core in bytes (mandatory).
+ * Size of binary image containing SPM Core in bytes (mandatory).
*/
uint32_t binary_size;
@@ -48,6 +48,6 @@
*/
uint16_t spmc_id;
-} spmc_manifest_sect_attribute_t;
+} spmc_manifest_attribute_t;
-#endif /* SPMC_MANIFEST_H */
+#endif /* SPM_CORE_MANIFEST_H */