summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdt/psci.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2018-02-23 19:08:56 +0000
committerkettenis <kettenis@openbsd.org>2018-02-23 19:08:56 +0000
commit45584b64b56a7a79f7810b5769d32515e13929a2 (patch)
tree26014a8fb159ab241ab414c41e7a341fc376ac94 /sys/dev/fdt/psci.c
parentclarify documentation of macro keys (diff)
downloadwireguard-openbsd-45584b64b56a7a79f7810b5769d32515e13929a2.tar.xz
wireguard-openbsd-45584b64b56a7a79f7810b5769d32515e13929a2.zip
Get rid of the cpu_on_fn hook and call the psci(4) functions directly instead
like we already do in the code that flushes the BTB. ok jsg@
Diffstat (limited to 'sys/dev/fdt/psci.c')
-rw-r--r--sys/dev/fdt/psci.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/fdt/psci.c b/sys/dev/fdt/psci.c
index 0dec743dc81..774b15ff89f 100644
--- a/sys/dev/fdt/psci.c
+++ b/sys/dev/fdt/psci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psci.c,v 1.5 2018/01/28 12:48:20 jsg Exp $ */
+/* $OpenBSD: psci.c,v 1.6 2018/02/23 19:08:56 kettenis Exp $ */
/*
* Copyright (c) 2016 Jonathan Gray <jsg@openbsd.org>
@@ -30,7 +30,6 @@
extern void (*cpuresetfn)(void);
extern void (*powerdownfn)(void);
-extern int (*cpu_on_fn)(register_t, register_t);
#define PSCI_VERSION 0x84000000
#define SYSTEM_OFF 0x84000008
@@ -57,7 +56,6 @@ int psci_match(struct device *, void *, void *);
void psci_attach(struct device *, struct device *, void *);
void psci_reset(void);
void psci_powerdown(void);
-int psci_cpu_on(register_t, register_t);
extern register_t hvc_call(register_t, register_t, register_t, register_t);
extern register_t smc_call(register_t, register_t, register_t, register_t);
@@ -123,8 +121,6 @@ psci_attach(struct device *parent, struct device *self, void *aux)
powerdownfn = psci_powerdown;
if (sc->sc_system_reset != 0)
cpuresetfn = psci_reset;
- if (sc->sc_cpu_on != 0)
- cpu_on_fn = psci_cpu_on;
}
uint32_t
@@ -155,11 +151,15 @@ psci_powerdown(void)
(*sc->sc_callfn)(sc->sc_system_off, 0, 0, 0);
}
-int
-psci_cpu_on(register_t mpidr, register_t pc)
+int32_t
+psci_cpu_on(register_t target_cpu, register_t entry_point_address,
+ register_t context_id)
{
struct psci_softc *sc = psci_sc;
- if (sc->sc_callfn)
- return (*sc->sc_callfn)(sc->sc_cpu_on, mpidr, pc, 0);
- return -1;
+
+ if (sc && sc->sc_callfn && sc->sc_cpu_on != 0)
+ return (*sc->sc_callfn)(sc->sc_cpu_on, target_cpu,
+ entry_point_address, context_id);
+
+ return PSCI_NOT_SUPPORTED;
}