diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2018-06-13 12:33:47 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2018-06-13 12:33:47 +0000 |
commit | 5add83935a135f802f0a047281757ad13eef0be5 (patch) | |
tree | cfca986b371e0205933770da4ac82e01740974a4 /sys/dev/psci/psci.c | |
parent | 4493861b9a5962b39240082971438184cc00733d (diff) | |
download | src-5add83935a135f802f0a047281757ad13eef0be5.tar.gz src-5add83935a135f802f0a047281757ad13eef0be5.zip |
Add a handler for the PSCI_FEATURES function. This needs PSCI 1.0, so
check for this, returning an error if the version is too old.
Sponsored by: DARPA, AFRL
Notes
Notes:
svn path=/head/; revision=335056
Diffstat (limited to 'sys/dev/psci/psci.c')
-rw-r--r-- | sys/dev/psci/psci.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c index b02ce11add08..bec5f9e8b7f1 100644 --- a/sys/dev/psci/psci.c +++ b/sys/dev/psci/psci.c @@ -414,6 +414,20 @@ psci_find_callfn(psci_callfn_t *callfn) return (PSCI_RETVAL_SUCCESS); } +int32_t +psci_features(uint32_t psci_func_id) +{ + + if (psci_softc == NULL) + return (PSCI_RETVAL_NOT_SUPPORTED); + + /* The feature flags were added to PSCI 1.0 */ + if (PSCI_VER_MAJOR(psci_softc->psci_version) < 1) + return (PSCI_RETVAL_NOT_SUPPORTED); + + return (psci_call(PSCI_FNID_FEATURES, psci_func_id, 0, 0)); +} + int psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) { |