summaryrefslogtreecommitdiff
path: root/services/psci/psci_common.c
diff options
context:
space:
mode:
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>2014-02-20 17:11:00 +0000
committerDan Handley <dan.handley@arm.com>2014-02-26 19:53:48 +0000
commit7f36660559a7d4786e9a30de6c5af74338ed9469 (patch)
tree83a0563d40d60b490b33ca079cdc24c5a1432fcc /services/psci/psci_common.c
parent9128ffe9413c4070ec08042dfee28f2aec9804ed (diff)
Implement late binding for runtime hooks
At present SPD power management hooks and BL3-2 entry are implemented using weak references. This would have the handlers bound and registered with the core framework at build time, but leaves them dangling if a service fails to initialize at runtime. This patch replaces implementation by requiring runtime handlers to register power management and deferred initialization hooks with the core framework at runtime. The runtime services are to register the hooks only as the last step, after having all states successfully initialized. Change-Id: Ibe788a2a381ef39aec1d4af5ba02376e67269782
Diffstat (limited to 'services/psci/psci_common.c')
-rw-r--r--services/psci/psci_common.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/services/psci/psci_common.c b/services/psci/psci_common.c
index cacd97eb..236309cf 100644
--- a/services/psci/psci_common.c
+++ b/services/psci/psci_common.c
@@ -41,10 +41,10 @@
#include "debug.h"
/*
- * Provide a null weak instantiation for SPD power management operations. An SPD
- * can define its own instance overriding this one
+ * SPD power management operations, expected to be supplied by the registered
+ * SPD on successful SP initialization
*/
-const spd_pm_ops __attribute__((weak)) spd_pm = {0};
+const spd_pm_ops *psci_spd_pm;
/*******************************************************************************
* Arrays that contains information needs to resume a cpu's execution when woken
@@ -556,3 +556,13 @@ void psci_afflvl_power_on_finish(unsigned long mpidr,
end_afflvl,
mpidr_nodes);
}
+
+/*******************************************************************************
+ * This function initializes the set of hooks that PSCI invokes as part of power
+ * management operation. The power management hooks are expected to be provided
+ * by the SPD, after it finishes all its initialization
+ ******************************************************************************/
+void psci_register_spd_pm_hook(const spd_pm_ops *pm)
+{
+ psci_spd_pm = pm;
+}