about summary refs log tree commit diff
path: root/arch
Commit message (Collapse)AuthorAgeFilesLines
* fix pread/pwrite syscall calling convention on shRich Felker2016-08-111-0/+1
| | | | | | | despite sh not generally using register-pair alignment for 64-bit syscall arguments, there are arch-specific versions of the syscall entry points for pread and pwrite which include a dummy argument for alignment before the 64-bit offset argument.
* fix regression in tcsetattr on all mips archsRich Felker2016-07-133-9/+9
| | | | | revert commit 8c316e9e49d37ad92c2e7493e16166a2afca419f. it was wrong and does not match how the kernel API works.
* remove or1k version of sem.hBobby Bingham2016-07-061-11/+0
| | | | | It's identical to the generic version, after evaluating the endian preprocessor checks in the generic version.
* make brace placement in public header typedef'd structs consistentRich Felker2016-07-038-18/+9
| | | | | | commit befa5866ee30d09c0c96e88af2eabff5911342ea performed this change for struct definitions that did not also involve typedef, but omitted the latter.
* make brace placement in public header struct definitions consistentRich Felker2016-07-0344-108/+54
| | | | | | | | | | | | | | placing the opening brace on the same line as the struct keyword/tag is the style I prefer and seems to be the prevailing practice in more recent additions. these changes were generated by the command: find include/ arch/*/bits -name '*.h' \ -exec sed -i '/^struct [^;{]*$/{N;s/\n/ /;}' {} + and subsequently checked by hand to ensure that the regex did not pick up any false positives.
* format mips bits/termios.h consistently mips64 and n32 versionsRich Felker2016-07-031-2/+1
| | | | with this change, all three files are identical.
* fix CBAUDEX in powerpc termios.hSzabolcs Nagy2016-07-032-2/+2
| | | | it seems it was a typo.
* fix TCS* definitions in mips termios.hSzabolcs Nagy2016-07-033-9/+9
| | | | these were incorrectly using the generic definitions.
* fix mips termios.h macro exposure/namespace issuesSzabolcs Nagy2016-07-033-45/+42
| | | | same changes to the defined macros as in powerpc and generic bits.
* fix powerpc termios.h macro exposure/namespace issuesSzabolcs Nagy2016-07-032-24/+24
| | | | | | | same changes as in the generic header. and BOTHER and IBSHIFT were removed (present in linux uapi but not in glibc) and TIOCSER_TEMT was added (present in glibc).
* fix generic termios.h macro exposure/namespace issuesSzabolcs Nagy2016-07-031-9/+14
| | | | | | | | | | | | | add EXTA, EXTB, CIBAUD, CMSPAR, XCASE macros and hide them as well as CBAUD, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN in standard mode. the new macros are both in glibc termios.h and in linux asm/termbits.h, the later also contains IBSHIFT and BOTHER, those were not added. these are not standard macros, but some of them are in the reserved namespace so could be exposed, the ones which are not reserved are CIBAUD, CMSPAR and XCASE (which was removed in issue 6), the rest got hidden to be consistent with glibc.
* fix FIOQSIZE in arm ioctl.hSzabolcs Nagy2016-07-033-0/+4
| | | | | arm ioctl.h is the same as the generic one except this macro, so a workaround solution is used to avoid another ioctl.h copy.
* remove termios2 related ioctls from sh ioctl.hSzabolcs Nagy2016-07-031-4/+0
| | | | musl does not define these on other targets either.
* fix TIOCMSET in mips ioctl.hSzabolcs Nagy2016-07-033-3/+3
| | | | it seems it was a typo.
* fix mips, mips64, mipsn32 TIOCM_* macros in ioctl.hSzabolcs Nagy2016-07-033-42/+42
| | | | | TIOCM_ macros were wrongly using the asm-generic/termios.h definitions instead of the mips specific ones from asm/termios.h
* remove mips and powerpc ioctls that are missing from linux uapiSzabolcs Nagy2016-07-035-31/+0
| | | | | | mips and powerpc use their own asm/ioctls.h, not the asm-generic/ioctls.h and they lack termiox macros that are available on other targets. see kernel commit 1d65b4a088de407e99714fdc27862449db04fb5c
* add missing TIOC* macros to ioctl.hSzabolcs Nagy2016-07-037-3/+40
| | | | | these are defined in linux asm/ioctls.h. (powerpc64 and powerpc bits/ioctl.h are now identical)
* add missing SIOCSIFNAME from linux/sockios.h to ioctl.hSzabolcs Nagy2016-07-037-0/+7
| | | | glibc ioctl.h has it too.
* remove ioctl macros that were removed from linux uapiSzabolcs Nagy2016-07-037-32/+0
| | | | | TIOCTTYGSTRUCT, TIOCGHAYESESP, TIOCSHAYESESP and TIOCM_MODEM_BITS were removed from the linux uapi and not present in glibc ioctl.h
* use the generic ioctl.h for x86_64, x32 and aarch64Szabolcs Nagy2016-07-033-607/+0
| | | | | they were slightly different in musl, but should be the same: the linux uapi and glibc headers are not different.
* add consistent reserved fields in mips64/n32 termios structuresRich Felker2016-07-032-0/+4
| | | | | | | | | | | | | | | | | | the (unused) speed fields were omitted when these ports were first added (within this release cycle, so not present in any release yet) in accordance with how glibc defines the structure on mips archs. however their omission does not match existing musl practice/intent. glibc provides its own, mostly-unified termios structure definition and performs translation in userspace to match the kernel structure for the arch, but has gratuitous differences on a few archs like mips, presumably as a result of historical mistakes. some other libcs use the kernel definitions directly. musl essentially does that, by matching the kernel layout in the part of the structure the kernel will read/write, but leaves additional space at the end for extensibility. these are nominally the (nonstandard) speed fields and (on most archs) extra c_cc elements, but since they are not used they could be repurposed if there's ever a need.
* fix posix_fadvise syscall args on powerpc, unify with arm fixRich Felker2016-07-012-0/+4
| | | | | | | | | commit 6d38c9cf80f47623e5e48190046673bbd0dc410b provided an arm-specific version of posix_fadvise to address the alternate argument order the kernel expects on arm, but neglected to address that powerpc (32-bit) has the same issue. instead of having arch variant files in duplicate, simply put the alternate version in the top-level file under the control of a macro defined in syscall_arch.h.
* add preadv2 and pwritev2 syscall numbers for linux v4.6Szabolcs Nagy2016-06-0911-0/+22
| | | | | | | | the syscalls take an additional flag argument, they were added in commit f17d8b35452cab31a70d224964cd583fb2845449 and a RWF_HIPRI priority hint flag was added to linux/fs.h in 97be7ebe53915af504fb491fb99f064c7cf3cb09. the syscall is not allocated for microblaze and sh yet.
* deduplicate __NR_* and SYS_* syscall number definitionsBobby Bingham2016-05-1216-5283/+885
|
* x32: eliminate __X32_SYSCALL_BIT constantBobby Bingham2016-05-121-317/+316
|
* x32: remove arch-specific syscall remappingBobby Bingham2016-05-121-20/+0
| | | | | These system calls are already all remapped in an arch-agnostic manner in src/internal/syscall.h
* fix spurious trailing whitespace in powerpc & powerpc64 bits/errno.hRich Felker2016-05-082-2/+2
|
* add powerpc64 portBobby Bingham2016-05-0828-0/+1907
|
* add mips n32 port (ILP32 ABI for mips64)Rich Felker2016-04-1831-0/+2009
| | | | based on patch submitted by Jaydeep Patil, with minor changes.
* add support for mips and mips64 r6 isaRich Felker2016-04-036-22/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | mips32r6 and mips64r6 are actually new isas at both the asm source and opcode levels (pre-r6 code cannot run on r6) and thus need to be treated as a new subarch. the following changes are made, some of which yield code generation improvements for non-r6 targets too: - add subarch logic in configure script and reloc.h files for dynamic linker name. - suppress use of .set mips2 asm directives (used to allow mips2 atomic instructions on baseline mips1 builds; the kernel has to emulate them on mips1) except when actually needed. they cause wrong instruction encodings on r6, and pessimize inlining on at least some compilers. - only hard-code sync instruction encoding on mips1. - use "ZC" constraint instead of "m" constraint for llsc memory operands on r6, where the ll/sc instructions no longer accept full 16-bit offsets. - only hard-code rdhwr instruction encoding with .word on targets (pre-r2) where it may need trap-and-emulate by the kernel. otherwise, just use the instruction mnemonic, and allow an arbitrary destination register to be used.
* fix regression disabling use of pause instruction for x86 a_spinRich Felker2016-03-293-3/+3
| | | | | | | | | | | commits e24984efd5c6ac5ea8e6cb6cd914fa8435d458bc and 16b55298dc4b6a54d287d7494e04542667ef8861 inadvertently disabled the a_spin implementations for i386, x86_64, and x32 by defining a macro named a_pause instead of a_spin. this should not have caused any functional regression, but it inhibited cpu relaxation while spinning for locks. bug reported by George Kulakowski.
* add copy_file_range syscall numbers from linux v4.5Szabolcs Nagy2016-03-199-0/+18
| | | | | | | it was introduced for offloading copying between regular files in linux commit 29732938a6289a15e907da234d6692a2ead71855 (microblaze and sh does not yet have the syscall number.)
* mips64: add recent linux syscall numbersSzabolcs Nagy2016-03-191-0/+6
| | | | add userfaultfd, membarrier and mlock2 system call numbers.
* deduplicate bits/mman.hSzabolcs Nagy2016-03-1812-617/+25
| | | | | | | | | | | currently five targets use the same mman.h constants and the rest share most constants too, so move them to sys/mman.h before the bits/mman.h include where the differences can be corrected by redefinition of the macros. this fixes two minor bugs: POSIX_MADV_DONTNEED was wrong on most targets (it should be the same as MADV_DONTNEED), and sh defined the x86-only MAP_32BIT mmap flag.
* correct pointer types for a_ll_p and a_sc_p primitives on mips64Rich Felker2016-03-111-4/+4
| | | | | | | | these changes should not affect generated code, but they reflect that the underlying objects operated on by a_cas_p are supposed to have type volatile void *, not volatile long. in theory a compiler could treat the effective type mismatch in the "m" memory operands as undefined behavior.
* make mips64 a_sc_p atomic primitive's asm constraints work with clangRich Felker2016-03-111-1/+1
| | | | | | | apparently clang does not accept matching-register input and output constraints that differ in size (32-bit vs 64-bit). based on patch by Jaydeep Patil.
* add powerpc soft-float supportFelix Fietkau2016-03-062-1/+12
| | | | | | | | | Some PowerPC CPUs (e.g. Freescale MPC85xx) have a completely different instruction set for floating point operations (SPE). Executing regular PowerPC floating point instructions results in "Illegal instruction" errors. Make it possible to run these devices in soft-float mode.
* add mips64 portRich Felker2016-03-0632-0/+2171
| | | | | patch by Mahesh Bodapati and Jaydeep Patil of Imagination Technologies.
* add sched_getcpu vDSO supportNathan Zadoks2016-03-021-0/+2
| | | | | This brings the call to an actually usable speed. Quick unscientific benchmark: 14ns : 102ns :: vDSO : syscall
* make aarch64 atomic_arch.h report that it defines pointer-sized ll/scRich Felker2016-02-231-0/+2
| | | | | | | | at present this is done only for consistency, since this file defines its own a_cas_p rather than using the new generic one from atomic.h added in commit 225f6a6b5b7173b6655e4f5d49b5b9fea70bf3bb. these definitions may however be useful if we ever need to add other pointer-sized atomic operations.
* remove workaround for broken mips assemblersRich Felker2016-02-081-4/+1
| | | | | | | | | | | | | | | | | | | | the workaround was for a bug that botched .gpword references to local labels, applying a nonsensical random offset of -0x4000 to them. this reverses commit 5e396fb996a80b035d0f6ecf7fed50f68aa3ebb7 and a removes a similar hack that was added to syscall_cp.s in the later commit 756c8af8589265e99e454fe3adcda1d0bc5e1963. it turns out one additional instance of the same idiom, the GETFUNCSYM macro in arch/mips/reloc.h, was still affected by the assembler bug and does not admit an easy workaround without making assumptions about how the macro is used. the previous workarounds made static linking work but left the early-stage dynamic linker broken and thus had limited usefulness. instead, affected users (using binutils versions older than 2.20) will need to fix the bug on the binutils side; the trivial patch is commit 453f5985b13e35161984bf1bf657bbab11515aa4 in the binutils-gdb repository.
* better a_sc inline asm constraint on aarch64 and armSzabolcs Nagy2016-01-312-3/+3
| | | | | | | | | | "Q" input constraint was used for the written object, instead of "=Q" output constraint. this should not cause problems because "memory" is on the clobber list, but "=Q" better documents the intent and more consistent with the actual asm code. this changes the generated code, because different registers are used, but other than the register names nothing should change.
* ldso: fix GDB dynamic linker info on MIPSFelix Fietkau2016-01-301-1/+1
| | | | | | | GDB is looking for a pointer to the ldso debug info in the data of the ..rld_map section. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* deduplicate the bulk of the arch bits headersRich Felker2016-01-2792-3194/+0
| | | | | | | | | | | | all bits headers that were identical for a number of 'clean' archs are moved to the new arch/generic tree. in addition, a few headers that differed only cosmetically from the new generic version are removed. additional deduplication may be possible in mman.h and in several headers (limits.h, posix.h, stdint.h) that mostly depend on whether the arch is 32- or 64-bit, but they are left alone for now because greater gains are likely possible with more invasive changes to header logic, which is beyond the scope of this commit.
* mips: add vdso supportHauke Mehrtens2016-01-271-0/+4
| | | | | | | | | | | | vdso support is available on mips starting with kernel 4.4, see kernel commit a7f4df4e21 "MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()" for details. In Linux kernel 4.4.0 the mips code returns -ENOSYS in case it can not handle the vdso call and assumes the libc will call the original syscall in this case. Handle this case in musl. Currently Linux kernel 4.4.0 handles the following types: CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME and CLOCK_MONOTONIC.
* fix siginfo_t for mipsSzabolcs Nagy2016-01-261-0/+9
| | | | | | | | si_errno and si_code are swapped in mips siginfo_t compared to other archs and some si_code values are different. This fix is required for POSIX timers to work. based on patch by Dmitry Ivanov.
* add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flagsSzabolcs Nagy2016-01-2610-0/+10
| | | | | | | | they lock faulted pages into memory (useful when a small part of a large mapped file needs efficient access), new in linux v4.4, commit b0f205c2a3082dd9081f9a94e50658c5fa906ff1 MLOCK_* is not in the POSIX reserved namespace for sys/mman.h
* add mlock2 syscall number from linux v4.4Szabolcs Nagy2016-01-268-0/+16
| | | | | | | this is mlock with a flags argument, new in linux commit a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e as usual microblaze and sh don't have allocated syscall number yet.
* add new membarrier, userfaultfd and switch_endian syscallsSzabolcs Nagy2016-01-268-0/+34
| | | | | | | | | | | | | | | new in linux v4.3 added for aarch64, arm, i386, mips, or1k, powerpc, x32 and x86_64. membarrier is a system wide memory barrier, moves most of the synchronization cost to one side, new in kernel commit 5b25b13ab08f616efd566347d809b4ece54570d1 userfaultfd is useful for qemu and is new in kernel commit 8d2afd96c20316d112e04d935d9e09150e988397 switch_endian is powerpc only for switching endianness, new in commit 529d235a0e190ded1d21ccc80a73e625ebcad09b
* add new i386 socket syscall numbersSzabolcs Nagy2016-01-261-0/+30
| | | | | | | | new in linux v4.3 commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb direct calls instead of socketcall allow better seccomp filtering. musl continues to use socketcalls internally on i386. (older kernels would need a fallback mechanism if the direct calls were used.)