summaryrefslogtreecommitdiff
path: root/include/plat/common
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2015-07-13 16:26:11 +0100
committerAchin Gupta <achin.gupta@arm.com>2015-08-13 23:48:06 +0100
commit5c8babcd70149db57734a38be432fe6625f3888f (patch)
treef64760007309c083896eac83638a5df9b57f3de1 /include/plat/common
parent674878464a93bb6d6bf6cb746fc4b9dba6e101ac (diff)
PSCI: Add deprecated API for SPD when compatibility is disabled
This patch defines deprecated platform APIs to enable Trusted Firmware components like Secure Payload and their dispatchers(SPD) to continue to build and run when platform compatibility is disabled. This decouples the migration of platform ports to the new platform API from SPD and enables them to be migrated independently. The deprecated platform APIs defined in this patch are : platform_get_core_pos(), platform_get_stack() and platform_set_stack(). The patch also deprecates MPIDR based context management helpers like cm_get_context_by_mpidr(), cm_set_context_by_mpidr() and cm_init_context(). A mechanism to deprecate APIs and identify callers of these APIs during build is introduced, which is controlled by the build flag WARN_DEPRECATED. If WARN_DEPRECATED is defined to 1, the users of the deprecated APIs will be flagged either as a link error for assembly files or compile time warning for C files during build. Change-Id: Ib72c7d5dc956e1a74d2294a939205b200f055613
Diffstat (limited to 'include/plat/common')
-rw-r--r--include/plat/common/common_def.h11
-rw-r--r--include/plat/common/platform.h9
2 files changed, 19 insertions, 1 deletions
diff --git a/include/plat/common/common_def.h b/include/plat/common/common_def.h
index 1b3203e1..077080df 100644
--- a/include/plat/common/common_def.h
+++ b/include/plat/common/common_def.h
@@ -67,6 +67,17 @@
#define MAKE_ULL(x) x
#endif
+/*
+ * Macros to wrap declarations of deprecated APIs within Trusted Firmware.
+ * The callers of these APIs will continue to compile as long as the build
+ * flag WARN_DEPRECATED is zero. Else the compiler will emit a warning
+ * when the callers of these APIs are compiled.
+ */
+#if WARN_DEPRECATED
+#define __warn_deprecated __attribute__ ((deprecated))
+#else
+#define __warn_deprecated
+#endif
#endif /* __COMMON_DEF_H__ */
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index f054cd0a..8071f394 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -228,6 +228,13 @@ int platform_setup_pm(const plat_pm_ops_t **);
unsigned int plat_get_aff_count(unsigned int, unsigned long);
unsigned int plat_get_aff_state(unsigned int, unsigned long);
-#endif /* __ENABLE_PLAT_COMPAT__ */
+#else
+/*
+ * The below function enable Trusted Firmware components like SPDs which
+ * haven't migrated to the new platform API to compile on platforms which
+ * have the compatibility layer disabled.
+ */
+unsigned int platform_get_core_pos(unsigned long mpidr) __warn_deprecated;
+#endif /* __ENABLE_PLAT_COMPAT__ */
#endif /* __PLATFORM_H__ */