10754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Copyright 2015 The Go Authors. All rights reserved. 20754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Use of this source code is governed by a BSD-style 30754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// license that can be found in the LICENSE file. 40754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 50754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot/* 60754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * Apple still insists on underscore prefixes for C function names. 70754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot */ 80754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#if defined(__APPLE__) 90754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#define EXT(s) _##s 100754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#else 110754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#define EXT(s) s 120754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#endif 130754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 140754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Apple's ld64 wants 4-byte alignment for ARM code sections. 150754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// .align in both Apple as and GNU as treat n as aligning to 2**n bytes. 160754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot.align 2 170754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 180754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot/* 190754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * void crosscall1(void (*fn)(void), void (*setg_gcc)(void *g), void *g) 200754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * 210754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * Calling into the gc tool chain, where all registers are caller save. 220754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * Called from standard ARM EABI, where x19-x29 are callee-save, so they 230754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot * must be saved explicitly, along with x30 (LR). 240754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot */ 250754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot.globl EXT(crosscall1) 260754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotEXT(crosscall1): 270754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x19, x20, [sp, #-16]! 280754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x21, x22, [sp, #-16]! 290754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x23, x24, [sp, #-16]! 300754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x25, x26, [sp, #-16]! 310754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x27, x28, [sp, #-16]! 320754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot stp x29, x30, [sp, #-16]! 330754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot mov x29, sp 340754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 350754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot mov x19, x0 360754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot mov x20, x1 370754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot mov x0, x2 380754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 390754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot blr x20 400754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot blr x19 410754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 420754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x29, x30, [sp], #16 430754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x27, x28, [sp], #16 440754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x25, x26, [sp], #16 450754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x23, x24, [sp], #16 460754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x21, x22, [sp], #16 470754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ldp x19, x20, [sp], #16 480754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot ret 490754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 500754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot 510754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#ifdef __ELF__ 520754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot.section .note.GNU-stack,"",%progbits 530754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#endif 54