summaryrefslogtreecommitdiff
path: root/arch/i386/bits/syscall.h
AgeCommit message (Collapse)AuthorFilesLines
2013-04-01add syscall numbers for the new kcmp and finit_module syscallsSzabolcs Nagy1-0/+4
and remove syscall todos from microblaze
2012-09-08syscall organization overhaulRich Felker1-286/+0
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.
2012-09-08add acct, accept4, setns, and dup3 syscalls (linux extensions)Rich Felker1-0/+3
based on patch by Justin Cormack
2012-09-02avoid "inline" in public headers for strict c89 compatibilityRich Felker1-14/+14
while musl itself requires a c99 compiler, some applications insist on being compiled with c89 compilers, and use of "inline" in the headers was breaking them. much of this had been avoided already by just skipping the inline keyword in pre-c99 compilers or modes, but this new unified solution is cleaner and may/should result in better code generation in the default gcc configuration.
2012-08-09add defines for number of sigset_t bytes syscalls expectRich Felker1-0/+2
yet another gratuitous mips incompatibility...
2012-06-23update syscall defs to latest kernel onesRich Felker1-0/+16
patch submitted by Kristian L. <email@thexception.net>
2012-04-04work around nasty gcc bug in the i386 syscall asmRich Felker1-4/+4
when the "r" (register) constraint is used to let gcc choose a register, gcc will sometimes assign the same register that was used for one of the other fixed-register operands, if it knows the values are the same. one common case is multiple zero arguments to a syscall. this horribly breaks the intended usage, which is swapping the GOT pointer from ebx into the temp register and back to perform the syscall. presumably there is a way to fix this with advanced usage of register constaints on the inline asm, but having bad memories about hellish compatibility issues with different gcc versions, for the time being i'm just going to hard-code specific registers to be used. this may hurt the compiler's ability to optimize, but it will fix serious miscompilation issues. so far the only function i know what compiled incorrectly is getrlimit.c, and naturally the bug only applies to shared (PIC) builds, but it may be more extensive and may have gone undetected..
2012-01-20add prlimit syscall wrapperRich Felker1-0/+2
2011-09-21update syscalls with off_t arguments to handle argument alignment, if neededRich Felker1-1/+2
the arm syscall abi requires 64-bit arguments to be aligned on an even register boundary. these new macros facilitate meeting the abi requirement without imposing significant ugliness on the code.
2011-06-14__syscall5 inline is having trouble with PIC; just use the function for nowRich Felker1-0/+7
2011-04-20add syscall wrappers for posix_fadvise, posix_fallocateRich Felker1-0/+4
2011-04-17overhaul pthread cancellationRich Felker1-1/+3
this patch improves the correctness, simplicity, and size of cancellation-related code. modulo any small errors, it should now be completely conformant, safe, and resource-leak free. the notion of entering and exiting cancellation-point context has been completely eliminated and replaced with alternative syscall assembly code for cancellable syscalls. the assembly is responsible for setting up execution context information (stack pointer and address of the syscall instruction) which the cancellation signal handler can use to determine whether the interrupted code was in a cancellable state. these changes eliminate race conditions in the previous generation of cancellation handling code (whereby a cancellation request received just prior to the syscall would not be processed, leaving the syscall to block, potentially indefinitely), and remedy an issue where non-cancellable syscalls made from signal handlers became cancellable if the signal handler interrupted a cancellation point. x86_64 asm is untested and may need a second try to get it right.
2011-03-28fix bug from syscall overhaul: extra __syscall_ret call for 0-arg syscallsRich Felker1-1/+1
this mainly just caused bloat, but could corrupt errno if a 0-arg syscall ever failed.
2011-03-19honor namespace for i386 syscall.h, even though it's not a standard headerRich Felker1-50/+50
2011-03-19syscall overhaul part two - unify public and internal syscall interfaceRich Felker1-0/+131
with this patch, the syscallN() functions are no longer needed; a variadic syscall() macro allows syscalls with anywhere from 0 to 6 arguments to be made with a single macro name. also, manually casting each non-integer argument with (long) is no longer necessary; the casts are hidden in the macros. some source files which depended on being able to define the old macro SYSCALL_RETURNS_ERRNO have been modified to directly use __syscall() instead of syscall(). references to SYSCALL_SIGSET_SIZE and SYSCALL_LL have also been changed. x86_64 has not been tested, and may need a follow-up commit to fix any minor bugs/oversights.
2011-03-19overhaul syscall interfaceRich Felker1-0/+810
this commit shuffles around the location of syscall definitions so that we can make a syscall() library function with both SYS_* and __NR_* style syscall names available to user applications, provides the syscall() library function, and optimizes the code that performs the actual inline syscalls in the library itself. previously on i386 when built as PIC (shared library), syscalls were incurring bus lock (lock prefix) overhead at entry and exit, due to the way the ebx register was being loaded (xchg instruction with a memory operand). now the xchg takes place between two registers. further cleanup to arch/$(ARCH)/syscall.h is planned.