1 /* -----------------------------------------------------------------------
2 eabi.S - Copyright (c) 2012, 2013 Anthony Green
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 ``Software''), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
14 The above copyright notice and this permission notice shall be included
15 in all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 OTHER DEALINGS IN THE SOFTWARE.
24 ----------------------------------------------------------------------- */
27 #include <fficonfig.h>
30 .globl ffi_prep_args_EABI
35 .type ffi_call_EABI, @function
50 /* Store incoming args on stack. */
51 sto.l 0($sp), $r0 /* ffi_prep_args */
52 sto.l 4($sp), $r1 /* ecif */
53 sto.l 8($sp), $r2 /* bytes */
54 sto.l 12($sp), $r3 /* flags */
55 sto.l 16($sp), $r4 /* &rvalue */
56 sto.l 20($sp), $r5 /* fn */
58 /* Call ffi_prep_args. */
59 mov $r6, $r4 /* Save result buffer */
60 mov $r7, $r5 /* Save the target fn */
61 mov $r8, $r3 /* Save the flags */
62 sub $sp, $r2 /* Allocate stack space */
63 mov $r0, $sp /* We can stomp over $r0 */
64 /* $r1 is already set up */
67 /* Load register arguments. */
75 /* Call the target function. */
100 .size ffi_call_EABI, .-ffi_call_EABI