1 /**************************************************************************/
2 /* */
3 /* OCaml */
4 /* */
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
6 /* */
7 /* Copyright 1998 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 .text
17
18 .global call_gen_code
19 .type call_gen_code, %function
20 .align 0
21 call_gen_code:
22 mov ip, sp
23 stmfd sp!, {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc}
24 sub fp, ip, #4
25 @ r0 is function to call
26 @ r1, r2, r3 are arguments 1, 2, 3
27 mov r4, r0
28 mov r0, r1
29 mov r1, r2
30 mov r2, r3
31 blx r4
32 ldmea fp, {r4, r5, r6, r7, r8, r9, fp, sp, pc}
33
34 .global caml_c_call
35 .type caml_c_call, %function
36 .align 0
37 caml_c_call:
38 @ function to call is in r10
39 bx r10
40
41 /* Mark stack as non-executable */
42 .section .note.GNU-stack,"",%progbits
43