about summary refs log tree commit diff
path: root/arch
Commit message (Collapse)AuthorAgeFilesLines
* add SIOCGSTAMPNS socket ioctl macro to ioctl.hSzabolcs Nagy2017-08-298-0/+8
| | | | | | | | | | it is defined in linux asm/sockios.h since commit ae40eb1ef30ab4120bd3c8b7e3da99ee53d27a23 (linux v2.6.22) but was missing from musl by accident. in musl the sockios macros are exposed in sys/ioctl.h together with other ioctl requests instead of in sys/socket.h because of namespace rules. (glibc has them in sys/socket.h under _GNU_SOURCE.)
* fix mips ioctl macros to match linux asm/sockios.hSzabolcs Nagy2017-08-293-15/+15
|
* fix build failure for sh4a due to missing colon in asm statementThomas Petazzoni2017-08-111-1/+1
| | | | | | Due to a missing ":" in an asm() statement, the "memory" clobber is considered by gcc as an input operand and not a clobber, which causes a build failure.
* fix omission of microblaze user.h definitionsRich Felker2017-06-211-1/+25
|
* remove long-obsolete clang workarounds from mips* syscall_arch.h filesRich Felker2017-05-313-157/+0
| | | | | | | at one point, clang reportedly failed to support the asm register constraints needed for inline syscalls. versions of clang that old have much bigger problems that preclude using them to compile musl libc.
* fix fstatat syscall on mips64Rich Felker2017-05-311-3/+22
| | | | | | | mips64 requires 'struct stat' conversion due to incorrect 32-bit fields where time_t should be in the kernel version of the structure. syscall_arch.h already performed the correct translation for stat, fstat, and lstat syscalls, but omitted special handling for fstatat.
* s390x: provide sigcontext struct definitionBobby Bingham2017-04-221-0/+15
| | | | | | | | This structure was missed when creating the s390x port. This is based on the report and patch from William Pitcock, but with a modified structure defintion to more closely match the kernel's definition.
* s390x: fix fpreg_t and remove unused per_structTuan M. Hoang2017-03-151-2/+2
| | | | | | | | | Including sys/procfs.h complains unknown type name 'fpreg_t' in bits/user.h. fpreg_t in bits/signal.h and elf_fpreg_t in bits/user.h are practically the same. per_struct is never used, even conflicts with kernel header asm/ptrace.h
* fix ld-behavior-dependent crash in ppc64 ldso startupRich Felker2017-03-081-1/+1
| | | | | | | the 32-bit pc-relative address for stage 2 of dynamic linker entry was wrongly loaded with a zero-extending load instead of sign-extending load, resulting in an invalid jump if the offset happened to be negative, which depends on the linker's ordering of text sections.
* allow page size to vary on armRich Felker2017-02-221-1/+0
| | | | | | | | | | | the ABI for arm was silently changed at some point to allow page sizes other than 4k; traditional binaries built with only 4k-aligned offsets between load segments cannot run on such systems, but newer binutils versions use 64k offset alignment. while larger page size is undesirable for various reasons, users have encountered hardware and/or kernels that lock the page size to a larger value, so follow the new ABI and allow it to vary.
* fix crashes in x32 __tls_get_addrrofl0r2017-01-131-0/+2
| | | | | | x32 has another gratuitous difference to all other archs: it passes an array of 64bit values to __tls_get_addr(). usually it is an array of size_t.
* reduce impact of REG_* namespace pollution in x86[_64] signal.hRich Felker2017-01-043-65/+130
| | | | | | | | | | | | | | | | | | when _GNU_SOURCE is defined, which is always the case when compiling c++ with gcc, these macros for the the indices in gregset_t are exposed and likely to clash with applications. by using enum constants rather than macros defined with integer literals, we can make the clash slightly less likely to break software. the macros are still defined in case anything checks for them with #ifdef, but they're defined to expand to themselves so that non-file-scope (e.g. namespaced) identifiers by the same names still work. for the sake of avoiding mistakes, the changes were generated with sed via the command: sed -i -e 's/#define *\(REG_[A-Z_0-9]\{1,\}\) *\([0-9]\{1,\}\)'\ '/enum { \1 = \2 };\n#define \1 \1/' \ arch/i386/bits/signal.h arch/x86_64/bits/signal.h arch/x32/bits/signal.h
* add pkey_{mprotect,alloc,free} syscalls from linux v4.9Szabolcs Nagy2016-12-299-0/+27
| | | | | see linux commit e8c24d3a23a469f1f40d4de24d872ca7023ced0a and linux Documentation/x86/protection-keys.txt
* rework arm atomic/tp backends to be thumb-compatible and fdpic-readyRich Felker2016-12-192-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | three problems are addressed: - use of pc arithmetic, which was difficult if not impossible to make correct in thumb mode on all models, so that relative rather than absolute pointers to the backends could be used. this was designed back when there was no coherent model for the early stages of the dynamic linker before relocations, and is no longer necessary. - assumption that data (the relative pointers to the backends) can be accessed at a constant displacement from the code. this will not be possible on future fdpic subarchs (for cortex-m), so move responsibility for loading the backend code address to the caller. - hard-coded arm opcodes using the .word directive. instead, use the .arch directive to work around the assembler's refusal to assemble instructions not available (or in some cases, available but just considered deprecated) in the target isa level. the obscure v6t2 arch is used for v6 code so as to (1) allow generation of thumb2 output if -mthumb is active, and (2) avoid warnings/errors for mcr barriers that clang would produce if we just set arch to v7-a. in addition, the __aeabi_read_tp function is moved out of the inner workings and implemented as an asm wrapper around a C function, so that asm code does not need to read global data. the asm wrapper serves to satisfy the ABI calling convention requirements for this function.
* fix use of incomplete struct type in s390x user.hBobby Bingham2016-12-161-10/+10
|
* fix typo in s390x user.hBobby Bingham2016-12-161-1/+1
|
* remove legacy i386 fallback stdarg implementation and frameworkRich Felker2016-12-152-13/+0
| | | | | | | | | this has been slated for removal for a long time. there is fundamentally no way to implement stdarg without compiler assistance; any attempt to do so has serious undefined behavior; its working depends not just (as a common misconception goes) on ABI, but also on assumptions about compiler code generation internal to a translation unit, which is not subject to external ABI constraints.
* work around gdb issues recognizing sigreturn trampoline on x86_64Rich Felker2016-11-122-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | gdb can only backtrace/unwind across signal handlers if it recognizes the sa_restorer trampoline. for x86_64, gdb first attempts to determine the symbol name for the function in which the program counter resides and match it against "__restore_rt". if no name can be found (e.g. in the case of a stripped binary), the exact instruction sequence is matched instead. when matching the function name, however, gdb's unwind code wrongly considers the interval [sym,sym+size] rather than [sym,sym+size). thus, if __restore_rt begins immediately after another function, gdb wrongly identifies pc as lying within the previous adjacent function. this patch adds a nop before __restore_rt to preclude that possibility. it also removes the symbol name __restore and replaces it with a macro since the stability of whether gdb identifies the function as __restore_rt or __restore is not clear. for the no-symbols case, the instruction sequence is changed to use %rax rather than %eax to match what gdb expects. based on patch by Szabolcs Nagy, with extended description and corresponding x32 changes added.
* add s390x portBobby Bingham2016-11-1127-0/+1097
|
* generalize ELF hash table types not to assume 32-bit entriesRich Felker2016-11-111-0/+1
| | | | | | | | | | alpha and s390x gratuitously use 64-bit entries (wasting 2x space and cache utilization) despite the values always being 32-bit. based on patch by Bobby Bingham, with changes suggested by Alexander Monakov to use the public Elf_Symndx type from link.h (and make it properly variable by arch) rather than adding new internal infrastructure for handling the type.
* add bits/hwcap.h and include it in sys/auxv.hSzabolcs Nagy2016-10-209-0/+137
| | | | | | | | | aarch64, arm, mips, mips64, mipsn32, powerpc, powerpc64 and sh have cpu feature bits defined in linux for AT_HWCAP auxv entry, so expose those in sys/auxv.h it seems the mips hwcaps were never exposed to userspace neither by linux nor by glibc, but that's most likely an oversight.
* add sh syscall numbers from linux v4.8Szabolcs Nagy2016-10-201-0/+14
| | | | | sh was updated in linux commit 74bdaa611fa69368fb4032ad437af073d31116bd to have numbers for new syscalls.
* fix preadv2 and pwritev2 syscall numbers on x32 for linux v4.8Szabolcs Nagy2016-10-201-2/+2
| | | | | the numbers were wrong in musl, but they were also wrong in the kernel and got fixed in v4.8 commit 3ebfd81f7fb3e81a754e37283b7f38c62244641a
* microblaze: add syscall numbers from linux v4.7Szabolcs Nagy2016-08-301-0/+3
| | | | | userfaultfd, membarrier and mlock2 syscalls got wired up in linux commit fbce3befd60d40639bf3c6b60f7477b2f988f92d
* 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