summaryrefslogtreecommitdiff
path: root/demo/smp.c
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-11-15 19:10:34 -0600
committerAlejandro Soto <alejandro@34project.org>2023-11-16 16:43:59 -0600
commit87a42e555bf952047e287f4c7810cd538595d5af (patch)
treed08db58fc3484bae6d63e5b2d69e66bf8c11cf95 /demo/smp.c
parentba803067cb54edece9ffa8b92f9bb97317d082e5 (diff)
rtl/smp: implement SMP dead/alive handling
Diffstat (limited to 'demo/smp.c')
-rw-r--r--demo/smp.c5
1 files changed, 5 insertions, 0 deletions
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);