Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/psci/psci.h
Show All 26 Lines | |||||
*/ | */ | ||||
#ifndef _MACHINE_PSCI_H_ | #ifndef _MACHINE_PSCI_H_ | ||||
#define _MACHINE_PSCI_H_ | #define _MACHINE_PSCI_H_ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <dev/psci/smccc.h> | #include <dev/psci/smccc.h> | ||||
#ifdef _KERNEL | |||||
typedef int (*psci_initfn_t)(device_t dev, int default_version); | typedef int (*psci_initfn_t)(device_t dev, int default_version); | ||||
typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, | typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, | ||||
register_t, register_t, register_t, register_t, | register_t, register_t, register_t, register_t, | ||||
struct arm_smccc_res *res); | struct arm_smccc_res *res); | ||||
extern int psci_present; | extern int psci_present; | ||||
int psci_cpu_on(unsigned long, unsigned long, unsigned long); | int psci_cpu_on(unsigned long, unsigned long, unsigned long); | ||||
void psci_reset(void); | void psci_reset(void); | ||||
int32_t psci_features(uint32_t); | int32_t psci_features(uint32_t); | ||||
int psci_get_version(void); | int psci_get_version(void); | ||||
/* Handler to let us call into the PSCI/SMCCC firmware */ | /* Handler to let us call into the PSCI/SMCCC firmware */ | ||||
extern psci_callfn_t psci_callfn; | extern psci_callfn_t psci_callfn; | ||||
static inline int | static inline int | ||||
psci_call(register_t a, register_t b, register_t c, register_t d) | psci_call(register_t a, register_t b, register_t c, register_t d) | ||||
{ | { | ||||
return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL)); | return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL)); | ||||
} | } | ||||
#endif | |||||
/* | /* | ||||
* PSCI return codes. | * PSCI return codes. | ||||
*/ | */ | ||||
#define PSCI_RETVAL_SUCCESS 0 | #define PSCI_RETVAL_SUCCESS 0 | ||||
#define PSCI_RETVAL_NOT_SUPPORTED -1 | #define PSCI_RETVAL_NOT_SUPPORTED -1 | ||||
#define PSCI_RETVAL_INVALID_PARAMS -2 | #define PSCI_RETVAL_INVALID_PARAMS -2 | ||||
#define PSCI_RETVAL_DENIED -3 | #define PSCI_RETVAL_DENIED -3 | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |