From b234b2c4a06169aa965b77dd40c17be454a9f609 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Thu, 15 Jan 2015 11:49:49 +0000 Subject: Verify capabilities before handling PSCI calls This patch implements conditional checks in psci_smc_handler() to verify that the psci function invoked by the caller is supported by the platform or SPD implementation. The level of support is saved in the 'psci_caps' variable. This check allows the PSCI implementation to return an error early. As a result of the above verification, the checks performed within the psci handlers for the pm hooks are now removed and replaced with assertions. Change-Id: I9b5b646a01d8566dc28c4d77dd3aa54e9bf3981a --- services/std_svc/psci/psci_system_off.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'services/std_svc/psci/psci_system_off.c') diff --git a/services/std_svc/psci/psci_system_off.c b/services/std_svc/psci/psci_system_off.c index f2520b6d..970d4bb5 100644 --- a/services/std_svc/psci/psci_system_off.c +++ b/services/std_svc/psci/psci_system_off.c @@ -30,20 +30,17 @@ #include #include +#include #include #include #include "psci_private.h" void psci_system_off(void) { - /* Check platform support */ - if (!psci_plat_pm_ops->system_off) { - ERROR("Platform has not exported a PSCI System Off hook.\n"); - panic(); - } - psci_print_affinity_map(); + assert(psci_plat_pm_ops->system_off); + /* Notify the Secure Payload Dispatcher */ if (psci_spd_pm && psci_spd_pm->svc_system_off) { psci_spd_pm->svc_system_off(); @@ -57,14 +54,10 @@ void psci_system_off(void) void psci_system_reset(void) { - /* Check platform support */ - if (!psci_plat_pm_ops->system_reset) { - ERROR("Platform has not exported a PSCI System Reset hook.\n"); - panic(); - } - psci_print_affinity_map(); + assert(psci_plat_pm_ops->system_reset); + /* Notify the Secure Payload Dispatcher */ if (psci_spd_pm && psci_spd_pm->svc_system_reset) { psci_spd_pm->svc_system_reset(); -- cgit