aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_arm.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/asm_arm.s')
-rw-r--r--src/runtime/asm_arm.s28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index 3e78d91143..36fb022f95 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -96,7 +96,7 @@ TEXT runtime·breakpoint(SB),NOSPLIT,$0-0
#ifdef GOOS_nacl
WORD $0xe125be7f // BKPT 0x5bef, NACL_INSTR_ARM_BREAKPOINT
#else
- WORD $0xe1200071 // BKPT 0x0001
+ WORD $0xe7f001f0 // undefined instruction that gdb understands is a software breakpoint
#endif
RET
@@ -480,15 +480,13 @@ TEXT gosave<>(SB),NOSPLIT,$0
// Call fn(arg) on the scheduler stack,
// aligned appropriately for the gcc ABI.
// See cgocall.c for more details.
-TEXT runtime·asmcgocall(SB),NOSPLIT,$0-8
- GO_ARGS
+TEXT ·asmcgocall(SB),NOSPLIT,$0-8
MOVW fn+0(FP), R1
MOVW arg+4(FP), R0
BL asmcgocall<>(SB)
RET
-TEXT runtime·asmcgocall_errno(SB),NOSPLIT,$0-12
- GO_ARGS
+TEXT ·asmcgocall_errno(SB),NOSPLIT,$0-12
MOVW fn+0(FP), R1
MOVW arg+4(FP), R0
BL asmcgocall<>(SB)
@@ -551,8 +549,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12
// cgocallback_gofunc(void (*fn)(void*), void *frame, uintptr framesize)
// See cgocall.c for more details.
-TEXT runtime·cgocallback_gofunc(SB),NOSPLIT,$8-12
- GO_ARGS
+TEXT ·cgocallback_gofunc(SB),NOSPLIT,$8-12
NO_LOCAL_POINTERS
// Load m and g from thread-local storage.
@@ -1303,3 +1300,20 @@ yieldloop:
RET
SUB $1, R1
B yieldloop
+
+// Called from cgo wrappers, this function returns g->m->curg.stack.hi.
+// Must obey the gcc calling convention.
+TEXT _cgo_topofstack(SB),NOSPLIT,$8
+ // R11 and g register are clobbered by load_g. They are
+ // callee-save in the gcc calling convention, so save them here.
+ MOVW R11, saveR11-4(SP)
+ MOVW g, saveG-8(SP)
+
+ BL runtime·load_g(SB)
+ MOVW g_m(g), R0
+ MOVW m_curg(R0), R0
+ MOVW (g_stack+stack_hi)(R0), R0
+
+ MOVW saveG-8(SP), g
+ MOVW saveR11-4(SP), R11
+ RET