[uClibc]Re: LFS on v850

Miles Bader miles at lsi.nec.co.jp
Fri Feb 22 05:30:18 UTC 2002


Erik Andersen <andersen at codepoet.org> writes:
> How about we just adjust syscalls.c with something like:
> 
>     -#ifdef __UCLIBC_HAVE_LFS__
>     +#if defined __UCLIBC_HAVE_LFS__ && ! defined(__v850__)

Well... it's a bit fragile, but I guess it'd work.

Surely there are other `register args only in syscalls' architectures
out there, though...?

Actually, let's see,...
`grep -nH -e _syscall2 $lk/include/asm-*/unistd.h' reveals that all the
supported architectures fall into one of following camps:

  (1) Use the stack to pass args, so no problem.  [this is: i386]

  (2) Use regs for syscall args, but 64-bit regs, so no problem.
      [this is: alpha, ia64, mips64, sparc64]

  (3) Use 32-bit regs for syscall args, and cast syscall arguments to
      (long) or (unsigned long) before assigning them to registers.
      This means that any 64-bit arguments will be silently truncated
      (and depending on the way the architecture generally passes
      arguments maybe even word-swapped).
      [this is: arm, cris, m68k, mips, parisc, s390, sh, sparc]

  (4) Uses 32-bit regs for syscall args, but doesn't cast arguments, so
      64-bit arguments will result in a compile-time error.
      [this is: v850]

So it looks like it's a much more general problem than just the v850,
but on the other affected architectures, will only result in mysterious
runtime failures.

-Miles
-- 
Saa, shall we dance?  (from a dance-class advertisement)



More information about the uClibc mailing list