diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2023-03-16 12:08:32 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2023-09-25 08:41:15 +0000 |
commit | a2228dc7015344b4d8d532f75c3eb175c56ac513 (patch) | |
tree | 1cbb68f44ac35b5d0836ffd35a7f052ec3780431 | |
parent | 7af7a0d1b14e669277f704eac0b8d3f82d327a9b (diff) | |
download | src-a2228dc7015344b4d8d532f75c3eb175c56ac513.tar.gz src-a2228dc7015344b4d8d532f75c3eb175c56ac513.zip |
Allow psci.h to be used by userspace
Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks.
This allows it to be used to implement PSCI and SMCCC by bhyve in
userspace.
Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 473ab212dc1f72c1765f112568237d229d4e0441)
-rw-r--r-- | sys/dev/psci/psci.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index 6eeab8ab6071..c34b5d0b104f 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -30,6 +30,7 @@ #include <sys/types.h> #include <dev/psci/smccc.h> +#ifdef _KERNEL typedef int (*psci_initfn_t)(device_t dev, int default_version); typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, register_t, register_t, register_t, register_t, @@ -50,6 +51,7 @@ 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)); } +#endif /* * PSCI return codes. @@ -100,6 +102,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) #define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) #define PSCI_VER_MINOR(v) ((v) & 0xFF) +#ifdef _KERNEL enum psci_fn { PSCI_FN_VERSION, PSCI_FN_CPU_SUSPEND, @@ -113,5 +116,6 @@ enum psci_fn { PSCI_FN_SYSTEM_RESET, PSCI_FN_MAX }; +#endif #endif /* _MACHINE_PSCI_H_ */ |