Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2023 11:00:41 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a2228dc70153 - stable/13 - Allow psci.h to be used by userspace
Message-ID:  <202309251100.38PB0f1R052254@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=a2228dc7015344b4d8d532f75c3eb175c56ac513

commit a2228dc7015344b4d8d532f75c3eb175c56ac513
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-03-16 12:08:32 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-09-25 08:41:15 +0000

    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)
---
 sys/dev/psci/psci.h | 4 ++++
 1 file changed, 4 insertions(+)

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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309251100.38PB0f1R052254>