This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Implement libffi for AARCH64:ILP32


Hi,
  The following GCC patch (I don't have the libffi code git checked
out) implements libffi for AARCH64:ILP32.  The majority of the AARCH64
code works correctly for ILP32.

For ILP32, we need to use long long types for ffi_arg and ffi_sarg.
And then we need to fix up the closure code to load cif, fn, and
user_data by 32bit instead of 64bits as they are stored as pointers in
C code.

With this patch, I got no failures in the libffi testsuite that is
included with GCC.

OK?  Built and tested on aarch64 with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
* src/aarch64/ffitarget.h (ffi_arg): Use unsigned long long for ILP32.
(ffi_sarg): Use signed long long for ILP32.

* src/aarch64/sysv.S (PTR_REG): New macro.
(PTR_SIZE): New macro.
(ffi_closure_SYSV): Load cif, fn and user_data using PTR_REG.
(ffi_go_closure_SYSV): Load cif and fn using PTR_REG.

Attachment: implementlibffiilp32.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]