From 3003baf1d0e3432818e810cf0bec51da9b23458a Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 19 Feb 2022 13:15:00 -0700 Subject: Macro to initialize cores --- include/macros.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/macros.inc (limited to 'include') diff --git a/include/macros.inc b/include/macros.inc new file mode 100644 index 0000000..9eac27a --- /dev/null +++ b/include/macros.inc @@ -0,0 +1,17 @@ +.macro init_core coreid + // set vector address. + ldr r0, =vector + mcr p15, 0, r0, c12, c0, 0 + cps #0x12 // Setup sp in IRQ mode. + ldr sp, =irq_stack_core\coreid + cps #0x11 // Setup sp in FIQ mode. + ldr sp, =fiq_stack_core\coreid + cps #0x1B // Setup sp in UNDEF mode. + ldr sp, =undefined_stack_core\coreid + cps #0x17 // Setup sp in ABORT mode. + ldr sp, =data_stack_core\coreid + cps #0x1f // Setup sp in USR/SYS mode. + ldr sp, =sys_stack_core\coreid + cps #0x13 // Setup sp in SVC mode. + ldr sp, =svc_stack_core\coreid +.endm -- cgit v1.2.1