From b5021c723a5ee267982c4779bb1b1d644e4d2d5c Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Tue, 22 Feb 2022 23:27:39 -0700 Subject: Started multithreading --- include/macros.inc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'include') diff --git a/include/macros.inc b/include/macros.inc index 18573af..ea44278 100644 --- a/include/macros.inc +++ b/include/macros.inc @@ -59,3 +59,29 @@ fiq_stack_core\coreid: .space 4096 sys_stack_core\coreid: .endm + +.macro core_task coreid +__l_\@: clrex + ldr r0, =mbox_core\coreid + ldrex r1, [r0] + cmp r1, #0 + wfeeq + beq __l_\@ + clrex + mov r0, #\coreid + blx r1 + ldr r0, =mbox_core\coreid + mov r1, #0 + str r1, [r0] + b __l_\@ +.endm + +.macro assign_ctask label, coreid + ldr r0, =mbox_core\coreid + ldr r1, =\label +__l_\@: ldr r2, [r0] + cmp r2, #0 + bne __l_\@ + str r1, [r0] + sev +.endm -- cgit v1.2.1