1 /**************************************************************************/
2 /* */
3 /* OCaml */
4 /* */
5 /* Xavier Leroy, projet Gallium, INRIA Rocquencourt */
6 /* */
7 /* Copyright 2013 Institut National de Recherche en Informatique et */
8 /* en Automatique. */
9 /* */
10 /* All rights reserved. This file is distributed under the terms of */
11 /* the GNU Lesser General Public License version 2.1, with the */
12 /* special exception on linking described in the file LICENSE. */
13 /* */
14 /**************************************************************************/
15
16 .globl call_gen_code
17 .align 2
18 call_gen_code:
19 /* Set up stack frame and save callee-save registers */
20 stp x29, x30, [sp, -160]!
21 add x29, sp, #0
22 stp x19, x20, [sp, 16]
23 stp x21, x22, [sp, 32]
24 stp x23, x24, [sp, 48]
25 stp x25, x26, [sp, 64]
26 stp x27, x28, [sp, 80]
27 stp d8, d9, [sp, 96]
28 stp d10, d11, [sp, 112]
29 stp d12, d13, [sp, 128]
30 stp d14, d15, [sp, 144]
31 /* Shuffle arguments */
32 mov x8, x0
33 mov x0, x1
34 mov x1, x2
35 mov x2, x3
36 mov x3, x4
37 /* Call generated asm */
38 blr x8
39 /* Reload callee-save registers and return address */
40 ldp x19, x20, [sp, 16]
41 ldp x21, x22, [sp, 32]
42 ldp x23, x24, [sp, 48]
43 ldp x25, x26, [sp, 64]
44 ldp x27, x28, [sp, 80]
45 ldp d8, d9, [sp, 96]
46 ldp d10, d11, [sp, 112]
47 ldp d12, d13, [sp, 128]
48 ldp d14, d15, [sp, 144]
49 ldp x29, x30, [sp], 160
50 ret
51
52 .globl caml_c_call
53 .align 2
54 caml_c_call:
55 br x15
56
57 /* Mark stack as non-executable */
58 .section .note.GNU-stack,"",%progbits
59