On Thursday 27 May 2010, Chris Metcalf wrote: > On 5/27/2010 10:11 AM, Arnd Bergmann wrote: > > The issue is that libc support for 64-bit operands on 32-bit platforms > tends to look like "syscall(foo64, arg1, LOW(arg2), HIGH(arg2))". This > naturally passes the arguments in consecutive registers, for a > register-based calling convention like ours. However, invoking > "foo64(arg1, (u64)arg2)" passes the u64 argument in the next consecutive > even/odd numbered pair of registers on our architecture. Arguably this > notion of register alignment isn't particularly helpful, but we opted to > do it this way when we settled on the API. The upshot is that to match > this, userspace needs to do "syscall(foo64, arg1, dummy, LOW(arg2), > HIGH(arg2))". So we need to provide these dummy-argument versions of > the syscall wrappers to all the libcs that we use (currently uclibc, > glibc, and sometimes newlib). Where the 64-bit argument falls naturally > on an even register boundary we don't need to provide any kernel stub. ok, makes sense. IIRC, the s390 architecture has the same requirement, probably some others as well. > Basically the scenario is your #2 above, but userspace already has an > implementation of the user-space wrapper in the generic code, and I'm > trying to avoid having to provide a tile-specific version of it. > > For reference, here's readahead() in glibc (overridden to be a pure > syscall wrapper for 64-bit architectures): > > ssize_t > __readahead (int fd, off64_t offset, size_t count) > { > return INLINE_SYSCALL (readahead, 4, fd, > __LONG_LONG_PAIR ((off_t) (offset >> 32), > (off_t) (offset & 0xffffffff)), > count); > } Ok, I see. No objection to your kernel code then, we just need to figure out how to do that with the generic sys_call_table. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html