| Commit message (Expand) | Author | Age | Files | Lines |
| * | apply hidden visibility to sigreturn code fragments•••these were overlooked in the declarations overhaul work because they
are not properly declared, and the current framework even allows their
declared types to vary by arch. at some point this should be cleaned
up, but I'm not sure what the right way would be.
| Rich Felker | 2018-09-12 | 1 | -1/+3 |
| * | define and use internal macros for hidden visibility, weak refs•••this cleans up what had become widespread direct inline use of "GNU C"
style attributes directly in the source, and lowers the barrier to
increased use of hidden visibility, which will be useful to recovering
some of the efficiency lost when the protected visibility hack was
dropped in commit dc2f368e565c37728b0d620380b849c3a1ddd78f, especially
on archs where the PLT ABI is costly.
| Rich Felker | 2018-09-05 | 1 | -2/+1 |
| * | add support for arch-specific ptrace command macros•••sys/ptrace.h is target specific, use bits/ptrace.h to add target
specific macro definitions.
these macros are kept in the generic sys/ptrace.h even though some
targets don't support them:
PTRACE_GETREGS
PTRACE_SETREGS
PTRACE_GETFPREGS
PTRACE_SETFPREGS
PTRACE_GETFPXREGS
PTRACE_SETFPXREGS
so no macro definition got removed in this patch on any target. only
s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK).
the PT_ aliases follow glibc headers, otherwise the definitions come
from linux uapi headers except ones that are skipped in glibc and
there is no real kernel support (s390x PTRACE_*_AREA) or need special
type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux
2.4 compatibility (PTRACE_OLDSETOPTIONS).
| Szabolcs Nagy | 2018-07-17 | 1 | -0/+9 |
| * | fix value of SO_PEERSEC on mips archs•••adapted from patch by Matthias Schiffer.
| Rich Felker | 2018-06-26 | 1 | -0/+1 |
| * | mips: add HWCAP_ flags from linux v4.17•••new in linux commit 256211f2b0b251e532d1899b115e374feb16fa7a
| Szabolcs Nagy | 2018-06-19 | 1 | -0/+1 |
| * | fix TLS layout of TLS variant I when there is a gap above TP•••In TLS variant I the TLS is above TP (or above a fixed offset from TP)
but on some targets there is a reserved gap above TP before TLS starts.
This matters for the local-exec tls access model when the offsets of
TLS variables from the TP are hard coded by the linker into the
executable, so the libc must compute these offsets the same way as the
linker. The tls offset of the main module has to be
alignup(GAP_ABOVE_TP, main_tls_align).
If there is no TLS in the main module then the gap can be ignored
since musl does not use it and the tls access models of shared
libraries are not affected.
The previous setup only worked if (tls_align & -GAP_ABOVE_TP) == 0
(i.e. TLS did not require large alignment) because the gap was
treated as a fixed offset from TP. Now the TP points at the end
of the pthread struct (which is aligned) and there is a gap above
it (which may also need alignment).
The fix required changing TP_ADJ and __pthread_self on affected
targets (aarch64, arm and sh) and in the tlsdesc asm the offset to
access the dtv changed too.
| Szabolcs Nagy | 2018-06-02 | 1 | -0/+1 |
| * | fix minor namespace issues in termios.h•••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.
| Rich Felker | 2018-03-10 | 1 | -0/+2 |
| * | add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15•••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*).
| Szabolcs Nagy | 2018-02-22 | 1 | -0/+1 |
| * | mips,powerpc: fix TIOCSER_TEMT in termios.h•••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.
| Szabolcs Nagy | 2018-02-22 | 1 | -1/+1 |
| * | ioctl TIOCGPTPEER from linux v4.13•••added for safe opening of peer end of pty in a mount namespace.
new in linux commit c6325179238f1d4683edbec53d8322575d76d7e2
| Szabolcs Nagy | 2017-11-05 | 1 | -0/+1 |
| * | add statx syscall numbers from linux v4.11•••statx was added in linux commit a528d35e8bfcc521d7cb70aaf03e1bd296c8493f
(there is no libc wrapper yet and microblaze and sh misses the number).
| Szabolcs Nagy | 2017-11-05 | 1 | -0/+1 |
| * | make syscall.h consistent with linux•••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.
| Szabolcs Nagy | 2017-09-06 | 2 | -8/+8 |
| * | add SIOCGSTAMPNS socket ioctl macro to ioctl.h•••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.)
| Szabolcs Nagy | 2017-08-29 | 1 | -0/+1 |
| * | fix mips ioctl macros to match linux asm/sockios.h | Szabolcs Nagy | 2017-08-29 | 1 | -5/+5 |
| * | remove long-obsolete clang workarounds from mips* syscall_arch.h files•••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.
| Rich Felker | 2017-05-31 | 1 | -41/+0 |
| * | add pkey_{mprotect,alloc,free} syscalls from linux v4.9•••see linux commit e8c24d3a23a469f1f40d4de24d872ca7023ced0a
and linux Documentation/x86/protection-keys.txt
| Szabolcs Nagy | 2016-12-29 | 1 | -0/+3 |
| * | add bits/hwcap.h and include it in sys/auxv.h•••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.
| Szabolcs Nagy | 2016-10-20 | 1 | -0/+2 |
| * | fix regression in tcsetattr on all mips archs•••revert commit 8c316e9e49d37ad92c2e7493e16166a2afca419f. it was wrong
and does not match how the kernel API works.
| Rich Felker | 2016-07-13 | 1 | -3/+3 |
| * | make brace placement in public header typedef'd structs consistent•••commit befa5866ee30d09c0c96e88af2eabff5911342ea performed this change
for struct definitions that did not also involve typedef, but omitted
the latter.
| Rich Felker | 2016-07-03 | 1 | -2/+1 |
| * | make brace placement in public header struct definitions consistent•••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.
| Rich Felker | 2016-07-03 | 5 | -12/+6 |
| * | format mips bits/termios.h consistently mips64 and n32 versions•••with this change, all three files are identical.
| Rich Felker | 2016-07-03 | 1 | -2/+1 |
| * | fix TCS* definitions in mips termios.h•••these were incorrectly using the generic definitions.
| Szabolcs Nagy | 2016-07-03 | 1 | -3/+3 |
| * | fix mips termios.h macro exposure/namespace issues•••same changes to the defined macros as in powerpc and generic bits.
| Szabolcs Nagy | 2016-07-03 | 1 | -15/+14 |
| * | fix TIOCMSET in mips ioctl.h•••it seems it was a typo.
| Szabolcs Nagy | 2016-07-03 | 1 | -1/+1 |
| * | fix mips, mips64, mipsn32 TIOCM_* macros in ioctl.h•••TIOCM_ macros were wrongly using the asm-generic/termios.h definitions
instead of the mips specific ones from asm/termios.h
| Szabolcs Nagy | 2016-07-03 | 1 | -14/+14 |
| * | remove mips and powerpc ioctls that are missing from linux uapi•••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
| Szabolcs Nagy | 2016-07-03 | 1 | -5/+0 |
| * | add missing TIOC* macros to ioctl.h•••these are defined in linux asm/ioctls.h.
(powerpc64 and powerpc bits/ioctl.h are now identical)
| Szabolcs Nagy | 2016-07-03 | 1 | -0/+8 |
| * | add missing SIOCSIFNAME from linux/sockios.h to ioctl.h•••glibc ioctl.h has it too.
| Szabolcs Nagy | 2016-07-03 | 1 | -0/+1 |
| * | remove ioctl macros that were removed from linux uapi•••TIOCTTYGSTRUCT, TIOCGHAYESESP, TIOCSHAYESESP and TIOCM_MODEM_BITS
were removed from the linux uapi and not present in glibc ioctl.h
| Szabolcs Nagy | 2016-07-03 | 1 | -4/+0 |
| * | add preadv2 and pwritev2 syscall numbers for linux v4.6•••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.
| Szabolcs Nagy | 2016-06-09 | 1 | -0/+2 |
| * | deduplicate __NR_* and SYS_* syscall number definitions | Bobby Bingham | 2016-05-12 | 1 | -362/+0 |
| * | add support for mips and mips64 r6 isa•••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.
| Rich Felker | 2016-04-03 | 3 | -10/+34 |
| * | add copy_file_range syscall numbers from linux v4.5•••it was introduced for offloading copying between regular files
in linux commit 29732938a6289a15e907da234d6692a2ead71855
(microblaze and sh does not yet have the syscall number.)
| Szabolcs Nagy | 2016-03-19 | 1 | -0/+2 |
| * | deduplicate bits/mman.h•••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.
| Szabolcs Nagy | 2016-03-18 | 1 | -45/+11 |
| * | remove workaround for broken mips assemblers•••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.
| Rich Felker | 2016-02-08 | 1 | -4/+1 |
| * | ldso: fix GDB dynamic linker info on MIPS•••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>
| Felix Fietkau | 2016-01-30 | 1 | -1/+1 |
| * | deduplicate the bulk of the arch bits headers•••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.
| Rich Felker | 2016-01-27 | 3 | -18/+0 |
| * | mips: add vdso support•••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.
| Hauke Mehrtens | 2016-01-27 | 1 | -0/+4 |
| * | fix siginfo_t for mips•••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.
| Szabolcs Nagy | 2016-01-26 | 1 | -0/+9 |
| * | add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flags•••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
| Szabolcs Nagy | 2016-01-26 | 1 | -0/+1 |
| * | add mlock2 syscall number from linux v4.4•••this is mlock with a flags argument, new in linux commit
a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e
as usual microblaze and sh don't have allocated syscall number yet.
| Szabolcs Nagy | 2016-01-26 | 1 | -0/+2 |
| * | add new membarrier, userfaultfd and switch_endian syscalls•••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
| Szabolcs Nagy | 2016-01-26 | 1 | -0/+4 |
| * | overhaul mips atomics for new atomics framework | Rich Felker | 2016-01-22 | 1 | -53/+31 |
| * | refactor internal atomic.h•••rather than having each arch provide its own atomic.h, there is a new
shared atomic.h in src/internal which pulls arch-specific definitions
from arc/$(ARCH)/atomic_arch.h. the latter can be extremely minimal,
defining only a_cas or new ll/sc type primitives which the shared
atomic.h will use to construct everything else.
this commit avoids making heavy changes to the individual archs'
atomic implementations. definitions which are identical or
near-identical to what the new shared atomic.h would produce have been
removed, but otherwise the changes made are just hooking up the
arch-specific files to the new infrastructure. major changes to take
advantage of the new system will come in subsequent commits.
| Rich Felker | 2016-01-21 | 2 | -205/+61 |
| * | adjust mips crt_arch entry point asm to avoid assembler bugs•••apparently the .gpword directive does not work reliably with local
text labels; values produced were offset by 64k from the correct
value, resulting in incorrect computation of the got pointer at
runtime. instead, use an external label so that the assembler does not
munge the relocation; the linker will then get it right.
commit 6fef8cafbd0f6f185897bc87feb1ff66e2e204e1 exposed this issue by
removing the old, non-PIE-compatible handwritten crt1.s, which was not
affected. presumably mips PIE executables (using Scrt1.o produced from
crt_arch.h) were already affected at the time.
| Rich Felker | 2015-12-29 | 1 | -1/+4 |
| * | remove visibility suppression by SHARED macro in mips and x32 arch files•••commit 8a8fdf6398b85c99dffb237e47fa577e2ddc9e77 was intended to remove
all such usage, but these arch-specific files were overlooked, leading
to inconsistent declarations and definitions.
| Rich Felker | 2015-12-15 | 1 | -2/+0 |
| * | properly access mcontext_t program counter in cancellation handler•••using the actual mcontext_t definition rather than an overlaid pointer
array both improves correctness/readability and eliminates some ugly
hacks for archs with 64-bit registers bit 32-bit program counter.
also fix UB due to comparison of pointers not in a common array
object.
| Rich Felker | 2015-11-02 | 1 | -1/+1 |
| * | add comment documenting hard-coded opcode for reading mips thread pointer | Rich Felker | 2015-10-15 | 1 | -0/+1 |
| * | fix signal return for sh/fdpic•••the restorer function pointer provided in the kernel sigaction
structure is interpreted by the kernel as a raw code address, not a
function descriptor.
this commit moves the declarations of the __restore and __restore_rt
symbols to ksigaction.h so that arch versions of the file can override
them, and introduces a version for sh which declares them as objects
rather than functions.
an alternate solution would have been defining SA_RESTORER to 0 so
that the functions are not used, but this both requires executable
stack (since the sh kernel does not have a vdso page with permanent
restorer functions) and crashes on qemu user-level emulation.
| Rich Felker | 2015-09-23 | 1 | -0/+2 |
| * | new dlstart stage-2 chaining for mips | Rich Felker | 2015-09-17 | 1 | -0/+15 |