github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/runtime/runtime_nintendoswitch.S (about) 1 // Macro for writing less code 2 .macro FUNC name 3 .section .text.\name, "ax", %progbits 4 .global \name 5 .type \name, %function 6 .align 2 7 \name: 8 .endm 9 10 FUNC armGetSystemTick 11 mrs x0, cntpct_el0 12 ret 13 14 // Horizon System Calls 15 // https://switchbrew.org/wiki/SVC 16 FUNC svcSetHeapSize 17 str x0, [sp, #-16]! 18 svc 0x1 19 ldr x2, [sp], #16 20 str x1, [x2] 21 ret 22 23 FUNC svcExitProcess 24 svc 0x7 25 ret 26 27 FUNC svcSleepThread 28 svc 0xB 29 ret 30 31 FUNC svcOutputDebugString 32 svc 0x27 33 ret 34 35 FUNC svcGetInfo 36 str x0, [sp, #-16]! 37 svc 0x29 38 ldr x2, [sp], #16 39 str x1, [x2] 40 ret