git: 2218070b2c3c - main - psci: finish psci_present implementation

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Sat, 19 Mar 2022 03:47:21 UTC
The branch main has been updated by kevans:

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

commit 2218070b2c3c32b1574f3f3b2d0579b2d4826554
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-03-19 03:03:44 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-03-19 03:04:32 +0000

    psci: finish psci_present implementation
    
    This was already declared in psci.h, but it was never defined/set.  Do
    this now, so we can use it to decide if enable-method in /cpus FDT nodes
    should be inspected later on.  While we're here, convert it to a
    boolean.
    
    Reviewed by:    andrew (slightly earlier version)
    Differential Revision:  https://reviews.freebsd.org/D34553
---
 sys/dev/psci/psci.c | 2 ++
 sys/dev/psci/psci.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/dev/psci/psci.c b/sys/dev/psci/psci.c
index f2bd4c698e5a..dd760d8e221a 100644
--- a/sys/dev/psci/psci.c
+++ b/sys/dev/psci/psci.c
@@ -84,6 +84,7 @@ static int psci_v0_1_init(device_t dev, int default_version);
 static int psci_v0_2_init(device_t dev, int default_version);
 
 struct psci_softc *psci_softc = NULL;
+bool psci_present;
 
 #ifdef __arm__
 #define	USE_ACPI	0
@@ -347,6 +348,7 @@ psci_attach(device_t dev, psci_initfn_t psci_init, int default_version)
 		return (ENXIO);
 
 	psci_softc = sc;
+	psci_present = true;
 
 	return (0);
 }
diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h
index f2c8a43c81ea..8004498426c5 100644
--- a/sys/dev/psci/psci.h
+++ b/sys/dev/psci/psci.h
@@ -37,7 +37,7 @@ typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t,
 	register_t, register_t, register_t, register_t,
 	struct arm_smccc_res *res);
 
-extern int psci_present;
+extern bool psci_present;
 
 int	psci_cpu_on(unsigned long, unsigned long, unsigned long);
 void	psci_reset(void);