This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Re: [PATCH] Consolidate Linux readahead() implementations



On 22/09/2016 17:59, Dmitry V. Levin wrote:
> On Thu, Sep 22, 2016 at 11:44:28PM +0300, Yury Norov wrote:
>> All Linux users pass 4 arguments to readahead() except arm and mips.
> 
> That's odd because 64-bit kernels take only 3 arguments, and powerpc takes 5.
> 
> 

Yes, it is because powerpc and 64-bits kernels syscalls wrappers are
generated by syscalls.list instead of C implementations.  On powerpc
it is generated by:

(echo '#define SYSCALL_NAME readahead'; \
 echo '#define SYSCALL_NARGS 5'; \
 echo '#define SYSCALL_SYMBOL __readahead'; \
 echo '#define SYSCALL_CANCELLABLE 0'; \
 echo '#define SYSCALL_NOERRNO 0'; \
 echo '#define SYSCALL_ERRVAL 0'; \
 echo '#include <syscall-template.S>'; \
 echo 'weak_alias (__readahead, readahead)'; \
 echo 'hidden_weak (readahead)'; \
...)

While on x86_64 it is:

(echo '#define SYSCALL_NAME readahead'; \
 echo '#define SYSCALL_NARGS 3'; \
 echo '#define SYSCALL_SYMBOL __readahead'; \
 echo '#define SYSCALL_CANCELLABLE 0'; \
 echo '#define SYSCALL_NOERRNO 0'; \
 echo '#define SYSCALL_ERRVAL 0'; \
 echo '#include <syscall-template.S>'; \
 echo 'weak_alias (__readahead, readahead)'; \
 echo 'hidden_weak (readahead)'; \

The 4 argument is only for 32-bit ABI the passes 64-bit arguments
in 2 registers.


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