github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/src/pkg/runtime/cgo/gcc_arm.S (about) 1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 /* 6 * Apple still insists on underscore prefixes for C function names. 7 */ 8 #if defined(__APPLE__) 9 #define EXT(s) _##s 10 #else 11 #define EXT(s) s 12 #endif 13 14 /* 15 * void crosscall_arm2(void (*fn)(void), void *g, void *m) 16 * 17 * Calling into the 5c tool chain, where all registers are caller save. 18 * Called from standard ARM EABI, where r4-r11 are callee-save, so they 19 * must be saved explicitly. 20 */ 21 .globl EXT(crosscall_arm2) 22 EXT(crosscall_arm2): 23 push {r4, r5, r6, r7, r8, r9, r10, r11, ip, lr} 24 mov r10, r1 // g 25 mov r9, r2 // m 26 mov r3, r0 // save r0, cgo_tls_set_gm will clobber it 27 bl EXT(x_cgo_save_gm) // save current g and m into TLS variable 28 mov lr, pc 29 mov pc, r3 30 pop {r4, r5, r6, r7, r8, r9, r10, r11, ip, pc} 31 32 .globl EXT(__stack_chk_fail_local) 33 EXT(__stack_chk_fail_local): 34 1: 35 b 1b 36 37 #ifdef __ELF__ 38 .section .note.GNU-stack,"",%progbits 39 #endif