github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/runtime/asm_arm.S (about) 1 // Only generate .debug_frame, don't generate .eh_frame. 2 .cfi_sections .debug_frame 3 4 .section .text.tinygo_scanCurrentStack 5 .global tinygo_scanCurrentStack 6 .type tinygo_scanCurrentStack, %function 7 tinygo_scanCurrentStack: 8 .cfi_startproc 9 // Save callee-saved registers onto the stack. 10 #if defined(__thumb2__) 11 push {r4-r11, lr} 12 .cfi_def_cfa_offset 9*4 13 #else 14 mov r0, r8 15 mov r1, r9 16 mov r2, r10 17 mov r3, r11 18 push {r0-r3, lr} 19 .cfi_def_cfa_offset 5*4 20 push {r4-r7} 21 .cfi_def_cfa_offset 4*4 22 #endif 23 24 // Scan the stack. 25 mov r0, sp 26 bl tinygo_scanstack 27 28 // Restore stack state and return. 29 add sp, #32 30 .cfi_def_cfa_offset 1*4 31 pop {pc} 32 .cfi_endproc 33 .size tinygo_scanCurrentStack, .-tinygo_scanCurrentStack 34 35 36 .section .text.tinygo_longjmp 37 .global tinygo_longjmp 38 .type tinygo_longjmp, %function 39 tinygo_longjmp: 40 .cfi_startproc 41 // Note: the code we jump to assumes r0 is set to a non-zero value if we 42 // jump from here (which is conveniently already the case). 43 44 ldm r0, {r0, r1} 45 mov sp, r0 // jumpSP 46 mov pc, r1 // jumpPC 47 .cfi_endproc 48 .size tinygo_longjmp, .-tinygo_longjmp