summaryrefslogtreecommitdiff
path: root/demo/smp.c
diff options
context:
space:
mode:
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);