summaryrefslogtreecommitdiff
path: root/tb/sim
diff options
context:
space:
mode:
Diffstat (limited to 'tb/sim')
-rw-r--r--tb/sim/smp_boot.S25
-rw-r--r--tb/sim/smp_boot.py4
2 files changed, 29 insertions, 0 deletions
diff --git a/tb/sim/smp_boot.S b/tb/sim/smp_boot.S
new file mode 100644
index 0000000..669508b
--- /dev/null
+++ b/tb/sim/smp_boot.S
@@ -0,0 +1,25 @@
+.global reset
+
+reset:
+ adr r0, cpus
+
+.inc_cpus:
+ ldrex r1, [r0]
+ add r1, r1, #1
+ strex r2, r1, [r0]
+ teq r2, #0
+ bne .inc_cpus
+
+ cmp r1, #1
+ movne pc, lr
+
+ ldr r1, =0x30140000
+ ldr r2, [r1]
+ ldr r3, =0x01010100
+ str r3, [r1]
+ ldr r3, [r1]
+.wait:
+ ldr r1, [r0]
+ b .wait
+
+cpus: .word 0
diff --git a/tb/sim/smp_boot.py b/tb/sim/smp_boot.py
new file mode 100644
index 0000000..40c3012
--- /dev/null
+++ b/tb/sim/smp_boot.py
@@ -0,0 +1,4 @@
+def final():
+ assert_reg(r1, 4)
+ assert_reg(r2, 0x01010100)
+ assert_reg(r3, 0)