about summary refs log tree commit diff
path: root/arch
Commit message (Collapse)AuthorAgeFilesLines
* remove a_ctz_l from arch specific atomic_arch.hAndre McCurdy2018-04-192-5/+5
| | | | | | | | Update atomic.h to provide a_ctz_l in all cases (atomic_arch.h should now only provide a_ctz_32 and/or a_ctz_64). The generic version of a_ctz_32 now takes advantage of a_clz_32 if available and the generic a_ctz_64 now makes use of a_ctz_32.
* fix minor namespace issues in termios.hRich Felker2018-03-106-0/+12
| | | | | | | | | | the output delay features (NL*, CR*, TAB*, BS*, and VT*) are XSI-shaded. VT* is in the V* namespace reservation but the rest need to be suppressed in base POSIX namespace. unfortunately this change introduces feature test macro checks into another bits header. at some point these checks should be simplified by having features.h handle the "FTM X implies Y" relationships.
* use PAGESIZE rather than PAGE_SIZE in user.h bitsRich Felker2018-03-104-8/+8
| | | | align with commit c9c2cd3e6955cb1d57b8be01d4b072bf44058762.
* reverse definition dependency between PAGESIZE and PAGE_SIZERich Felker2018-03-106-6/+6
| | | | | | PAGESIZE is actually the version defined in POSIX base, with PAGE_SIZE being in the XSI option. use PAGESIZE as the underlying definition to facilitate making exposure of PAGE_SIZE conditional.
* aarch64: add sve_context struct and related defines from linux v4.15Szabolcs Nagy2018-02-221-0/+39
| | | | | signal context definitions for scalable vector extension new in commit d0b8cd3187889476144bd9b13bf36a932c3e7952
* aarch64: update hwcap.h for linux v4.15Szabolcs Nagy2018-02-221-0/+6
| | | | | | HWCAP_SVE is new in linux commit 43994d824e8443263dc98b151e6326bf677be52e HWCAP_SHA3, HWCAP_SM3, HWCAP_SM4, HWCAP_ASIMDDP and HWCAP_SHA512 are new in f5e035f8694c3bdddc66ea46ecda965ee6853718
* arm: add get_tls syscall from linux v4.15Szabolcs Nagy2018-02-221-0/+1
| | | | | for systems without tp register or kuser helper, new in linux commit 8fcd6c45f5a65621ec809b7866a3623e9a01d4ed
* powerpc: update hwcap.h for linux v4.15Szabolcs Nagy2018-02-222-0/+6
| | | | | | | PPC_FEATURE2_HTM_NO_SUSPEND is new in linux commit cba6ac4869e45cc93ac5497024d1d49576e82666 PPC_FEATURE2_DARN and PPC_FEATURE2_SCV were new in v4.12 in commit a4700a26107241cc7b9ac8528b2c6714ff99983d
* s390x: add s390_sthyi system call from v4.15Szabolcs Nagy2018-02-221-0/+1
| | | | | to store hypervisor information, added in linux commit 3d8757b87d7fc15a87928bc970f060bc9c6dc618
* add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15Szabolcs Nagy2018-02-225-0/+5
| | | | | | | | for synchronous page faults, new in linux commit 1c9725974074a047f6080eecc62c50a8e840d050 and b6fb293f2497a9841d94f6b57bd2bb2cd222da43 note that only targets that use asm-generic/mman.h have this new flag defined, so undef it on other targets (mips*, powerpc*).
* mips,powerpc: fix TIOCSER_TEMT in termios.hSzabolcs Nagy2018-02-225-5/+5
| | | | | | use the same token to define TIOCSER_TEMT as is used in ioctl.h so when both headers are included there are no redefinition warnings during musl build.
* aarch64: add HWCAP_DCPOP from linux v4.14Szabolcs Nagy2018-02-221-0/+1
| | | | | indicates ARMv8.2-DCPoP persistent memory support extension. new in linux commit 7aac405ebb3224037efd56b73d82d181111cdac3
* aarch64: fix mismatched type of ucontext_t uc_link memberWilliam Pitcock2018-01-311-1/+1
|
* fix x32 unistd macros to report as ILP32 not LP64Nicholas Wilson2017-12-141-2/+2
|
* s390x: use generic ioctl.hSzabolcs Nagy2017-11-052-196/+2
| | | | | | | | s390 can use the generic ioctls definitions other than FIOQSIZE (like arm). this fixes some missing ioctls and two incorrect ones: TIOCTTYGSTRUCT and TIOCM_MODEM_BITS seem to be defined on frv target only in linux.
* microblaze: add statx syscall from linux v4.13Szabolcs Nagy2017-11-051-0/+1
| | | | | statx number is allocated for microblaze in linux commit f5ef419630e85e80284cd0256cb5a13a66bbd6c5
* aarch64: add extra_context struct from linux v4.13Szabolcs Nagy2017-11-051-0/+7
| | | | | allows expanding the signal frame beyond the 4k reserved space. new in linux commit 33f082614c3443d937f50fe936f284f62bbb4a1b
* ioctl TIOCGPTPEER from linux v4.13Szabolcs Nagy2017-11-057-0/+7
| | | | | added for safe opening of peer end of pty in a mount namespace. new in linux commit c6325179238f1d4683edbec53d8322575d76d7e2
* s390x: add syscall number for s390_guarded_storage from linux v4.12Szabolcs Nagy2017-11-051-0/+1
| | | | new syscall in linux commit 916cda1aa1b412d7cf2991c3af7479544942d121
* i386: add arch_prctl syscall number from linux v4.12Szabolcs Nagy2017-11-051-0/+1
| | | | | syscall for i386 compat mode on x86_64 for non-x86_64 prctls. new in linux commit 79170fda313ed5be2394f87aa2a00d597f8ed4a1
* aarch64: add new HWCAP_* flags from linux v4.12Szabolcs Nagy2017-11-051-0/+3
| | | | | | | hwcap bits for armv8.3 extensions, added in linux commits c8c3798d2369e4285da44b244638eafe446a8f8a cb567e79fa504575cb97fb2f866d2040ed1c92e7 c651aae5a7732287c1c9bc974ece4ed798780544
* add statx syscall numbers from linux v4.11Szabolcs Nagy2017-11-0512-0/+12
| | | | | statx was added in linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (there is no libc wrapper yet and microblaze and sh misses the number).
* update aarch64 hwcap.h for linux v4.11Szabolcs Nagy2017-11-051-0/+2
| | | | | | new hwcap bits were added in kernel commits 77c97b4ee21290f5f083173d957843b615abbff2 f92f5ce01ee6a6a86cbfc4e3b0d18529c302b1ea
* add kexec_file_load syscall number on powerpc from linux v4.10Szabolcs Nagy2017-11-052-0/+2
| | | | added in linux commit 80f60e509a03ff9ff2bdbf9cd1e935c6360b8bd9
* add microblaze syscall numbers from linux v4.10Szabolcs Nagy2017-11-051-0/+6
| | | | missing syscalls got allocated on microblaze.
* fix build regression on ARM for ISA levels less than v5Rich Felker2017-10-251-0/+4
| | | | | | | | | | | commit 06fbefd10046a0fae7e588b7c6d25fb51811b931 (first included in release 1.1.17) introduced this regression. patch by Adrian Bunk. it fixes the regression in all cases, but spuriously prevents use of the clz instruction on very old compiler versions that don't define __ARM_ARCH. this may be fixed in a more general way at some point in the future. it also omits thumb1 logic since building as thumb1 code is currently not supported.
* powerpc{64}: fix MAP_NORESERVE and MAP_LOCKED in mman.hSzabolcs Nagy2017-09-112-1/+11
| | | | MAP_{NORESERVE,LOCKED} have different values on powerpc than in generic.
* make syscall.h consistent with linuxSzabolcs Nagy2017-09-0610-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | most of the found naming differences don't matter to musl, because internally it unifies the syscall names that vary across targets, but for external code the names should match the kernel uapi. aarch64: __NR_fstatat is called __NR_newfstatat in linux. __NR_or1k_atomic got mistakenly copied from or1k. arm: __NR_arm_sync_file_range is an alias for __NR_sync_file_range2 __NR_fadvise64_64 is called __NR_arm_fadvise64_64 in linux, the old non-arm name is kept too, it should not cause issues. (powerpc has similar nonstandard fadvise and it uses the normal name.) i386: __NR_madvise1 was removed from linux in commit 303395ac3bf3e2cb488435537d416bc840438fcb 2011-11-11 microblaze: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite had different name in linux. mips: __NR_fadvise, __NR_fstatat, __NR_pread, __NR_pwrite, __NR_select had different name in linux. mipsn32: __NR_fstatat is called __NR_newfstatat in linux. or1k: __NR__llseek is called __NR_llseek in linux. the old name is kept too because that's the name musl uses internally. powerpc: __NR_{get,set}res{gid,uid}32 was never present in powerpc linux. __NR_timerfd was briefly defined in linux but then got renamed.
* arm: add HWCAP_ARM_ hwcap macrosSzabolcs Nagy2017-08-291-0/+24
| | | | | | | Glibc renamed the linux uapi HWCAP_* macros to HWCAP_ARM_* so have both variants in case some code depends on it. (The HWCAP2_ macros are not defined in glibc currently so those only have the linux uapi variant.)
* add a_clz_64 helper functionSzabolcs Nagy2017-08-297-0/+49
| | | | | | | | | counts leading zero bits of a 64bit int, undefined on zero input. (has nothing to do with atomics, added to atomic.h so target specific helper functions are together.) there is a logarithmic generic implementation and another in terms of a 32bit a_clz_32 on targets where that's available.
* s390x: add bits/hwcap.hSzabolcs Nagy2017-08-291-0/+15
| | | | | aligned with linux arch/s390/include/asm/elf.h (these macros should be exported into uapi, but they are not)
* 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
|