From 87a42e555bf952047e287f4c7810cd538595d5af Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 15 Nov 2023 19:10:34 -0600 Subject: rtl/smp: implement SMP dead/alive handling --- demo/smp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demo/smp.c') diff --git a/demo/smp.c b/demo/smp.c index 4357d35..8bf220e 100644 --- a/demo/smp.c +++ b/demo/smp.c @@ -3,6 +3,11 @@ #define SMP_CTRL_BASE 0x30140000 #define SMP_CTRL (*(volatile unsigned *)SMP_CTRL_BASE) +int cpu_is_alive(unsigned num) +{ + return !!(SMP_CTRL & (0b100 << (num * 8))); +} + void run_cpu(unsigned num) { run_cpus(1 << num); -- cgit v1.2.3