summaryrefslogtreecommitdiff
path: root/arch/x32
AgeCommit message (Collapse)AuthorLines
2014-12-23add new syscall numbers for bpf and kexec_file_loadSzabolcs Nagy-0/+4
these syscalls are new in linux v3.18, bpf is present on all supported archs except sh, kexec_file_load is only allocted for x86_64 and x32 yet. bpf was added in linux commit 99c55f7d47c0dc6fc64729f37bf435abf43f4c60 kexec_file_load syscall number was allocated in commit f0895685c7fd8c938c91a9d8a6f7c11f22df58d2
2014-12-21move wint_t definition to the shared part of alltypes.h.inRich Felker-1/+0
2014-10-10add explicit barrier operation to internal atomic.h APIRich Felker-0/+5
2014-10-08add new syscall numbers for seccomp, getrandom, memfd_createSzabolcs Nagy-0/+6
these syscalls are new in linux v3.17 and present on all supported archs except sh. seccomp was added in commit 48dc92b9fc3926844257316e75ba11eb5c742b2c it has operation, flags and pointer arguments (if flags==0 then it is the same as prctl(PR_SET_SECCOMP,...)), the uapi header for flag definitions is linux/seccomp.h getrandom was added in commit c6e9d6f38894798696f23c8084ca7edbf16ee895 it provides an entropy source when open("/dev/urandom",..) would fail, the uapi header for flags is linux/random.h memfd_create was added in commit 9183df25fe7b194563db3fec6dc3202a5855839c it allows anon mmap to have an fd, that can be shared, sealed and needs no mount point, the uapi header for flags is linux/memfd.h
2014-09-06add threads.h and needed per-arch types for mtx_t and cnd_tRich Felker-0/+2
based on patch by Jens Gustedt. mtx_t and cnd_t are defined in such a way that they are formally "compatible types" with pthread_mutex_t and pthread_cond_t, respectively, when accessed from a different translation unit. this makes it possible to implement the C11 functions using the pthread functions (which will dereference them with the pthread types) without having to use the same types, which would necessitate either namespace violations (exposing pthread type names in threads.h) or incompatible changes to the C++ name mangling ABI for the pthread types. for the rest of the types, things are much simpler; using identical types is possible without any namespace considerations.
2014-08-20add max_align_t definition for C11 and C++11Rich Felker-0/+2
unfortunately this needs to be able to vary by arch, because of a huge mess GCC made: the GCC definition, which became the ABI, depends on quirks in GCC's definition of __alignof__, which does not match the formal alignment of the type. GCC's __alignof__ unexpectedly exposes the an implementation detail, its "preferred alignment" for the type, rather than the formal/ABI alignment of the type, which it only actually uses in structures. on most archs the two values are the same, but on some (at least i386) the preferred alignment is greater than the ABI alignment. I considered using _Alignas(8) unconditionally, but on at least one arch (or1k), the alignment of max_align_t with GCC's definition is only 4 (even the "preferred alignment" for these types is only 4).
2014-08-17make pointers used in robust list volatileRich Felker-1/+1
when manipulating the robust list, the order of stores matters, because the code may be asynchronously interrupted by a fatal signal and the kernel will then access the robust list in what is essentially an async-signal context. previously, aliasing considerations made it seem unlikely that a compiler could reorder the stores, but proving that they could not be reordered incorrectly would have been extremely difficult. instead I've opted to make all the pointers used as part of the robust list, including those in the robust list head and in the individual mutexes, volatile. in addition, the format of the robust list has been changed to point back to the head at the end, rather than ending with a null pointer. this is to match the documented kernel robust list ABI. the null pointer, which was previously used, only worked because faults during access terminate the robust list processing.
2014-07-27clean up unused and inconsistent atomics in arch dirsRich Felker-25/+0
the a_cas_l, a_swap_l, a_swap_p, and a_store_l operations were probably used a long time ago when only i386 and x86_64 were supported. as other archs were added, support for them was inconsistent, and they are obviously not in use at present. having them around potentially confuses readers working on new ports, and the type-punning hacks and inconsistent use of types in their definitions is not a style I wish to perpetuate in the source tree, so removing them seems appropriate.
2014-07-20add syscall numbers for the new renameat2 syscallSzabolcs Nagy-0/+2
it's like rename but with flags eg. to allow atomic exchange of two files, introduced in linux 3.15 commit 520c8b16505236fc82daa352e6c5e73cd9870cff
2014-06-18refactor to remove arch-specific relocation code from dynamic linkerRich Felker-27/+20
this was one of the main instances of ugly code duplication: all archs use basically the same types of relocations, but roughly equivalent logic was duplicated for each arch to account for the different naming and numbering of relocation types and variation in whether REL or RELA records are used. as an added bonus, both REL and RELA are now supported on all archs, regardless of which is used by the standard toolchain.
2014-06-16dynamic linker: permit error returns from arch-specific reloc functionRich Felker-1/+2
the immediate motivation is supporting TLSDESC relocations which require allocation and thus may fail (unless we pre-allocate), but this mechanism should also be used for throwing an error on unsupported or invalid relocation types, and perhaps in certain cases, for reporting when a relocation is not satisfiable.
2014-05-30add sched_{get,set}attr syscall numbers and SCHED_DEADLINE macroSzabolcs Nagy-0/+6
linux 3.14 introduced sched_getattr and sched_setattr syscalls in commit d50dde5a10f305253cbc3855307f608f8a3c5f73 and the related SCHED_DEADLINE scheduling policy in commit aab03e05e8f7e26f51dee792beddcb5cca9215a5 but struct sched_attr "extended scheduling parameters data structure" is not yet exported to userspace (necessary for using the syscalls) so related uapi definitions are not added yet.
2014-04-15fix RLIMIT_ constants for mipsSzabolcs Nagy-0/+0
The mips arch is special in that it uses different RLIMIT_ numbers than other archs, so allow bits/resource.h to override the default RLIMIT_ numbers (empty on all archs except mips). Reported by orc.
2014-04-15add namespace-protected name for sysinfo functionRich Felker-1/+4
it will be needed to implement some things in sysconf, and the syscall can't easily be used directly because the x32 syscall uses the wrong structure layout. the l (uncreative, for "linux") prefix is used since the symbol name __sysinfo is already taken for AT_SYSINFO from the aux vector. the way the x32 override of this function works is also changed to be simpler and avoid the useless jump instruction.
2014-03-18fix signal.h breakage from moving stack_t to arch-specific bitsRich Felker-6/+6
in the previous changes, I missed the fact that both the prototype of the sigaltstack function and the definition of ucontext_t depend on stack_t.
2014-03-18move signal.h definition of stack_t to arch-specific bitsRich Felker-0/+6
it's different at least on mips. mips version will be fixed in a separate commit to show the change.
2014-03-17x32: fix struct statfsrofl0r-2/+4
the omission of the padding was uncovered by the latest regression statvfs regression test added to libc-test.
2014-03-11move struct semid_ds to from shared sys/sem.h to bitsRich Felker-0/+16
the definition was found to be incorrect at least for powerpc, and fixing this cleanly requires making the definition arch-specific. this will allow cleaning up the definition for other archs to make it more specific, and reversing some of the ugliness (time_t hacks) introduced with the x32 port. this first commit simply copies the existing definition to each arch without any changes. this is intentional, to make it easier to review changes made on a per-arch basis.
2014-03-06x32: fix sysinfo()rofl0r-0/+47
the kernel uses long longs in the struct, but the documentation says they're long. so we need to fixup the mismatch between the userspace and kernelspace structs. since the struct offers a mem_unit member, we can avoid truncation by adjusting that value.
2014-02-23make the x32 port use the correct ld-musl-x32.path filenameRich Felker-1/+1
previously it was wrongly using the x86_64 one, precluding having both x32 and x86_64 libs present on the same system.
2014-02-23fix x32 syscall arch.h timespec fixup coderofl0r-53/+49
it's legal to call the __syscall functions with more arguments than necessary, and the __syscall_cp cancel dummy impl. does just that. thus we must insert the switch for all possible syscalls numbers into all of the syscallN inline functions.
2014-02-23fix some issues in x32 syscall_cp_fixuprofl0r-11/+8
- the nanosleep fixup "fixed" the second timespec* argument erroneusly. - the futex fixup was missing the check for FUTEX_WAIT. - general cleanup using a macro.
2014-02-23mostly-cosmetic fixups to x32 port mergeRich Felker-1/+1
2014-02-23x32 port (diff against vanilla x86_64)rofl0r-679/+762
2014-02-23import vanilla x86_64 code as x32rofl0r-0/+1986