about summary refs log tree commit diff
path: root/arch/i386/syscall_arch.h
Commit message (Collapse)AuthorAgeFilesLines
* overhaul i386 syscall mechanism not to depend on external asm sourceRich Felker2019-04-101-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is the first part of a series of patches intended to make __syscall fully self-contained in the object file produced using syscall.h, which will make it possible for crt1 code to perform syscalls. the (confusingly named) i386 __vsyscall mechanism, which this commit removes, was introduced before the presence of a valid thread pointer was mandatory; back then the thread pointer was setup lazily only if threads were used. the intent was to be able to perform syscalls using the kernel's fast entry point in the VDSO, which can use the sysenter (Intel) or syscall (AMD) instruction instead of int $128, but without inlining an access to the __syscall global at the point of each syscall, which would incur a significant size cost from PIC setup everywhere. the mechanism also shuffled registers/calling convention around to avoid spills of call-saved registers, and to avoid allocating ebx or ebp via asm constraints, since there are plenty of broken-but-supported compiler versions which are incapable of allocating ebx with -fPIC or ebp with -fno-omit-frame-pointer. the new mechanism preserves the properties of avoiding spills and avoiding allocation of ebx/ebp in constraints, but does it inline, using some fairly simple register shuffling, and uses a field of the thread structure rather than global data for the vdso-provided syscall code address. for now, the external __syscall function is refactored not to use the old __vsyscall so it can be kept, but the intent is to remove it too.
* change the internal socketcall selection logicSzabolcs Nagy2016-01-261-0/+2
| | | | | | | | only use SYS_socketcall if SYSCALL_USE_SOCKETCALL is defined internally, otherwise use direct syscalls. this commit does not change the current behaviour, it is preparation for adding direct syscall numbers for i386.
* use hidden visibility for i386 asm-internal __vsyscall symbolRich Felker2015-04-141-7/+7
| | | | | otherwise the call instruction in the inline syscall asm results in textrels without ld-time binding.
* add vdso clock_gettime acceleration support to i386Rich Felker2014-06-061-0/+4
|
* make socketcall types common as they are same for all architecturesTimo Teräs2014-04-171-22/+0
|
* remove __SYSCALL_SSLEN arch macro in favor of using public _NSIGRich Felker2013-03-261-2/+0
| | | | | | | | | | | | | | the issue at hand is that many syscalls require as an argument the kernel-ABI size of sigset_t, intended to allow the kernel to switch to a larger sigset_t in the future. previously, each arch was defining this size in syscall_arch.h, which was redundant with the definition of _NSIG in bits/signal.h. as it's used in some not-quite-portable application code as well, _NSIG is much more likely to be recognized and understood immediately by someone reading the code, and it's also shorter and less cluttered. note that _NSIG is actually 65/129, not 64/128, but the division takes care of throwing away the off-by-one part.
* ensure pointer decay in inline-asm arg for i386 syscall6Rich Felker2012-10-131-1/+1
| | | | | | | | this is actually a rather subtle issue: do arrays decay to pointers when used as inline asm args? gcc says yes, but currently pcc says no. hopefully this discrepency in pcc will be fixed, but since the behavior is not clearly defined anywhere I can find, I'm using an explicit operation to cause the decay to occur.
* i386 vsyscall support (vdso-provided sysenter/syscall instruction based)Rich Felker2012-10-111-66/+7
| | | | | | this doubles the performance of the fastest syscalls on the atom I tested it on; improvement is reportedly much more dramatic on worst-case cpus. cannot be used for cancellable syscalls.
* syscall organization overhaulRich Felker2012-09-081-0/+136
now public syscall.h only exposes __NR_* and SYS_* constants and the variadic syscall function. no macros or inline functions, no __syscall_ret or other internal details, no 16-/32-bit legacy syscall renaming, etc. this logic has all been moved to src/internal/syscall.h with the arch-specific parts in arch/$(ARCH)/syscall_arch.h, and the amount of arch-specific stuff has been reduced to a minimum. changes still need to be reviewed/double-checked. minimal testing on i386 and mips has already been performed.