Undo iOS ARM64 changes.

This commit is contained in:
Anthony Green
2013-12-05 16:23:25 -05:00
parent 356b2cbc30
commit 3dc3f32c35
19 changed files with 630 additions and 817 deletions

View File

@@ -23,25 +23,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <fficonfig.h>
#include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h>
#else
#ifdef __USER_LABEL_PREFIX__
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
/* Use the right prefix for global labels. */
#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
#else
#define CNAME(x) x
#endif
#endif
#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#define cfi_restore(reg) .cfi_restore reg
#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
.text
.globl ffi_call_SYSV
.type ffi_call_SYSV, #function
/* ffi_call_SYSV()
Create a stack frame, setup an argument context, call the callee
@@ -63,7 +53,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
extended_cif *),
struct call_context *context,
extended_cif *,
size_t required_stack_size,
unsigned required_stack_size,
void (*fn)(void));
Therefore on entry we have:
@@ -91,13 +81,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define ffi_call_SYSV_FS (8 * 4)
.text
.globl CNAME(ffi_call_SYSV)
#ifdef __ELF__
.type CNAME(ffi_call_SYSV), #function
#endif
.cfi_startproc
CNAME(ffi_call_SYSV):
ffi_call_SYSV:
stp x29, x30, [sp, #-16]!
cfi_adjust_cfa_offset (16)
cfi_rel_offset (x29, 0)
@@ -107,11 +92,11 @@ CNAME(ffi_call_SYSV):
cfi_def_cfa_register (x29)
sub sp, sp, #ffi_call_SYSV_FS
stp x21, x22, [sp, #0]
stp x21, x22, [sp, 0]
cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS)
cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS)
stp x23, x24, [sp, #16]
stp x23, x24, [sp, 16]
cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS)
cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS)
@@ -195,9 +180,7 @@ CNAME(ffi_call_SYSV):
ret
.cfi_endproc
#ifdef __ELF__
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
#endif
.size ffi_call_SYSV, .-ffi_call_SYSV
#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE)
@@ -238,10 +221,10 @@ CNAME(ffi_call_SYSV):
Voila! */
.text
.globl CNAME(ffi_closure_SYSV)
.text
.globl ffi_closure_SYSV
.cfi_startproc
CNAME(ffi_closure_SYSV):
ffi_closure_SYSV:
stp x29, x30, [sp, #-16]!
cfi_adjust_cfa_offset (16)
cfi_rel_offset (x29, 0)
@@ -287,7 +270,7 @@ CNAME(ffi_closure_SYSV):
trampoline was called. */
add x2, x29, #16
bl CNAME(ffi_closure_SYSV_inner)
bl ffi_closure_SYSV_inner
/* Figure out if we should touch the vector registers. */
ldr x0, [x22, #8]
@@ -321,6 +304,4 @@ CNAME(ffi_closure_SYSV):
ret
.cfi_endproc
#ifdef __ELF__
.size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV)
#endif
.size ffi_closure_SYSV, .-ffi_closure_SYSV