[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

(E)GLIBC: inline syscalls



Hi all,

The GNU/kFreeBSD port of the GNU libc uses normal syscalls (each syscall
is mapped to a function), while the GNU/Linux version only uses inline
syscalls (each syscall is mapped to asm inline code). The difference
mainly comes from the fact that the FreeBSD kernel is also using the
architecture ABI convention for the syscalls, while the Linux kernel
uses its own convention.

Starting with glibc 2.10, some code starts to work only if inline 
syscalls are used. I have submitted a patch upstream (GLIBC),
but it has been rejected [1]. I plan to also submit it to EGLIBC, I do
not know if it will be accepted, however I start to fear that
non-inline syscalls support will be progressively removed. And some
parts are deep inside ld.so, I am not sure we can fork that
indefinitely, even in EGLIBC.

So let's talk about switching GNU/kFreeBSD to inline syscalls.

For amd64, I already have a patch for syscalls with 6 arguments or less
(when the stack is not used), it should not be a problem to add the code
to pass one more argument on the stack. I think it can bring a small 
gain in speed when the number of args is not too high (when the stack 
is not used), which is the majority of syscalls.

For i386 the situation is more complex. We need to pass up to 8 
arguments to a syscall (especially when passing 64-bit values in
two arguments), which is exactly the number of registers we have on
this CPU. And they should in fine all be passed on the stack.

Does anyone has an idea of a technical solution (not gcc version 
dependent) to get this working on i386? Does anyone has an opinion to 
share about that?

Cheers,
Aurelien

[1] http://sources.redhat.com/bugzilla/show_bug.cgi?id=10192

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: