15 Jan, 2006

11 commits

  • Patch from Nicolas Pitre

    We need NWFPE if we want to support execution of legacy binaries with
    an EABI kernel.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    This patch adds the required code to support both user space ABIs at
    the same time. A second syscall table is created to include legacy ABI
    syscalls that need an ABI compat wrapper.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    The difference between EABI and the legacy ABI may affect either
    structure member alignment and/or argument register selection.

    The patch has the details.

    Included are wrappers for the following syscalls:

    sys_stat64
    sys_lstat64
    sys_fstat64
    sys_fcntl64
    sys_epoll_ctl
    sys_epoll_wait
    sys_ipc
    sys_semop
    sys_semtimedop
    sys_pread64
    sys_pwrite64
    sys_truncate64
    sys_ftruncate64
    sys_readahead

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    struct statfs64 has extra padding with EABI growing its size from 84 to
    88. This struct is now __attribute__((packed,aligned(4))) with a small
    assembly wrapper to force the sz argument to 84 if it is 88 to avoid
    copying the extra padding over user space memory unexpecting it.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    This adds the configuration option, and disables any FPA floating point
    emulators which are not EABI compatible.

    It also disables Acorn RISC OS/Arthur binary support when CONFIG_EABI=y
    since it is incompatible with an EABI kernel.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    Fix a few syscalls for EABI requirements. They were sys_pread64 and
    sys_pwrite64 where the last argument is now entirely pushed on stack,
    but since commit 567bd98017d9c9f2ac1c148ddc78c062e8abd398 they don't
    require any fixup. Remains only the stat64 structure. Non EABI kernels
    are unaffected.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    For a while we wanted to change the way syscalls were called on ARM.
    Instead of encoding the syscall number in the swi instruction which
    requires reading back the instruction from memory to extract that number
    and polluting the data cache, it was decided that simply storing the
    syscall number into r7 would be more efficient. Since this represents
    an ABI change then making that change at the same time as EABI support
    is the right thing to do.

    It is now expected that EABI user space binaries put the syscall number
    into r7 and use "swi 0" to call the kernel. Syscall register argument
    are also expected to have "EABI arrangement" i.e. 64-bit arguments
    should be put in a pair of registers from an even register number.

    Example with long ftruncate64(unsigned int fd, loff_t length):

    legacy ABI:
    - put fd into r0
    - put length into r1-r2
    - use "swi #(0x900000 + 194)" to call the kernel

    new ARM EABI:
    - put fd into r0
    - put length into r2-r3 (skipping over r1)
    - put 194 into r7
    - use "swi 0" to call the kernel

    Note that it is important to use 0 for the swi argument as backward
    compatibility with legacy ABI user space relies on this.
    The syscall macros in asm-arm/unistd.h were also updated to support
    both ABIs and implement the right call method automatically.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    The ARM EABI defines new names for GCC helper functions.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    We must make sure that assembly code that modifies the stack pointer
    before calling a C function does it so it remains 64-bit aligned.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    The ARM EABI says that the stack pointer has to be 64-bit aligned for
    reasons already mentioned in patch #3101 when calling C functions.

    We therefore must verify and adjust sp accordingly when taking an
    exception from kernel mode since sp might not necessarily be 64-bit
    aligned if the exception occurs in the middle of a kernel function.

    If the exception occurs while in user mode then no sp fixup is needed as
    long as sizeof(struct pt_regs) as well as any additional syscall data
    stack space remain multiples of 8.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Patch from Nicolas Pitre

    Although ARM is still using 32-bit pointers, version 5 and later
    versions of the ARM architecture introduced the ldrd and strd
    instructions to move 64-bit data which must be 64-bit aligned in memory,
    and the EABI includes new constraints on structure data alignment to
    allow for the compiler to use those instructions. This means that any
    slab allocation must start on a 64-bit boundary which is not equivalent
    to BYTES_PER_WORD, especially on those architecture versions that
    implements the ldrd/strd instructions.

    Overriding the default alignment disables some slab debug features. If
    those debug features are really needed then the kernel will have to be
    compiled for version 4 of the ARM architecture.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     

14 Jan, 2006

8 commits


13 Jan, 2006

21 commits