1. 01 8月, 2019 1 次提交
    • R
      get/setsockopt: add fallback for new time64 SO_RCVTIMEO/SO_SNDTIMEO · 51fd67fc
      Rich Felker 提交于
      without this, the SO_RCVTIMEO and SO_SNDTIMEO socket options would
      stop working on pre-5.1 kernels after time_t is switched to 64-bit and
      their values are changed to the new time64 versions.
      
      new code is written such that it's statically unreachable on 64-bit
      archs, and on existing 32-bit archs until the macro values are changed
      to activate 64-bit time_t.
      51fd67fc
  2. 31 7月, 2019 1 次提交
    • R
      move IPC_64 from public bits/ipc.h to syscall_arch.h · f56d57f8
      Rich Felker 提交于
      the definition of the IPC_64 macro controls the interface between libc
      and the kernel through syscalls; it's not a public API. the meaning is
      rather obscure. long ago, Linux's sysvipc *id_ds structures used
      16-bit uids/gids and wrong types for a few other fields. this was in
      the libc5 era, before glibc. the IPC_64 flag (64 is a misnomer; it's
      more like 32) tells the kernel to use the modern[-ish] versions of the
      structures.
      
      the definition of IPC_64 has nothing to do with whether the arch is
      32- or 64-bit. rather, due to either historical accident or
      intentional obnoxiousness, the kernel only accepts and masks off the
      0x100 IPC_64 flag conditional on CONFIG_ARCH_WANT_IPC_PARSE_VERSION,
      i.e. for archs that want to provide, or that accidentally provided,
      both. for archs which don't define this option, no masking is
      performed and commands with the 0x100 bit set will fail as invalid. so
      ultimately, the definition is just a matter of matching an arbitrary
      switch defined per-arch in the kernel.
      f56d57f8
  3. 30 7月, 2019 4 次提交
    • R
      remove duplicates of new generic bits/msg.h · b74b3eb4
      Rich Felker 提交于
      b74b3eb4
    • R
      remove duplicates of new generic bits/sem.h · de5e56ce
      Rich Felker 提交于
      some of these were not exact duplicates, but had gratuitously
      different naming for padding, or omitted the endian checks because the
      arch is fixed-endian.
      de5e56ce
    • R
      extricate bits/sem.h from x32 time_t hack · 1afe5f3e
      Rich Felker 提交于
      various padding fields in the generic bits/sem.h were defined in terms
      of time_t as a cheap hack standing in for "kernel long", to allow x32
      to use the generic version of the file. this was a really bad idea, as
      it ended up getting copied into lots of arch-specific versions of the
      bits file, and is a blocker to changing time_t to 64-bit on 32-bit
      archs.
      
      this commit adds an x32-specific version of the header, and changes
      padding type back from time_t to long (currently the same type on all
      archs but x32) in the generic header and all the others the hack got
      copied into.
      1afe5f3e
    • R
      remove duplicates of new generic bits/shm.h · 484c34fe
      Rich Felker 提交于
      484c34fe
  4. 19 7月, 2019 3 次提交
    • R
      remove mips/n32/64 stat struct hacks from syscall machinery · fa7d4218
      Rich Felker 提交于
      now that we have a kstat structure decoupled from the public struct
      stat, we can just use the broken kernel structures directly and let
      the code in fstatat do the translation.
      fa7d4218
    • R
      decouple struct stat from kernel type · 01ae3fc6
      Rich Felker 提交于
      presently, all archs/ABIs have struct stat matching the kernel
      stat[64] type, except mips/mipsn32/mips64 which do conversion hacks in
      syscall_arch.h to work around bugs in the kernel type. this patch
      completely decouples them and adds a translation step to the success
      path of fstatat. at present, this is just a gratuitous copying, but it
      opens up multiple possibilities for future support for 64-bit time_t
      on 32-bit archs and for cleaned-up/unified ABIs.
      
      for clarity, the mips hacks are not yet removed in this commit, so the
      mips kstat structs still correspond to the output of the hacks in
      their syscall_arch.h files, not the raw kernel type. a subsequent
      commit will fix this.
      01ae3fc6
    • R
      remove utterly wrong includes from mips64/n32 bits/stat.h · 62a73d96
      Rich Felker 提交于
      these were overlooked during review. bits headers are not allowed to
      pull in additional headers (note: that rule is currently broken in
      other places but just for endian.h). string.h has no place here
      anyway, and including bits/alltypes.h without defining macros to
      request types from it is a nop.
      62a73d96
  5. 17 7月, 2019 2 次提交
    • R
      clean up mips64/n32 syscall asm constraints · ddc7c4f9
      Rich Felker 提交于
      ever since inline syscalls were added for (o32) mips in commit
      328810d3, the asm has nonsensically
      loaded the syscall number, rather than taking $2 as an input
      constraint to let the compiler load it. commit
      cfc09b1e improved on this somewhat by
      allowing a constant syscall number to propagate into an immediate, but
      missed that the whole operation made no sense.
      
      now, only $4, $5, $6, $8, and $9 are potential input-only registers.
      $2 is always input and output, and $7 is both when it's an argument,
      otherwise output-only. previously, $7 was treated as an input (with a
      "1" constraint matching its output position) even when it was not an
      input, which was arguably undefined behavior (asm input from
      indeterminate value). this is corrected.
      ddc7c4f9
    • R
      deduplicate mips64/n32 syscall clobbered register lists · db2a148d
      Rich Felker 提交于
      this patch is not purely non-functional changes, since before, $8 and
      $9 were wrongly in the clobberlist for syscalls with fewer than 5 or 6
      arguments. of course it's impossible for syscalls to have different
      clobbers depending on their number of arguments. the clobberlist for
      the recently-added 5- and 6-argument forms was correct, and for the 0-
      to 4-argument forms was erroneously copied from the mips o32 ABI where
      the additional arguments had to be passed on the stack.
      
      in making this change, I reviewed the kernel sources, and $8 and $9
      are always saved for 64-bit kernels since they're part of the syscall
      argument list for n32 and n64 ABIs.
      db2a148d
  6. 11 7月, 2019 1 次提交
  7. 02 7月, 2019 2 次提交
    • S
      add new syscall numbers from linux v5.1 · f3f96f2d
      Szabolcs Nagy 提交于
      syscall numbers are now synced up across targets (starting from 403 the
      numbers are the same on all targets other than an arch specific offset)
      
      IPC syscalls sem*, shm*, msg* got added where they were missing (except
      for semop: only semtimedop got added), the new semctl, shmctl, msgctl
      imply IPC_64, see
      
        linux commit 0d6040d4681735dfc47565de288525de405a5c99
        arch: add split IPC system calls where needed
      
      new 64bit time_t syscall variants got added on 32bit targets, see
      
        linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
        y2038: add 64-bit time_t syscalls to all 32-bit architectures
      
      new async io syscalls got added, see
      
        linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
        Add io_uring IO interface
      
        linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
        io_uring: add support for pre-mapped user IO buffers
      
      a new syscall got added that uses the fd of /proc/<pid> as a stable
      handle for processes: allows sending signals without pid reuse issues,
      intended to eventually replace rt_sigqueueinfo, kill, tgkill and
      rt_tgsigqueueinfo, see
      
        linux commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
        signal: add pidfd_send_signal() syscall
      
      on some targets (arm, m68k, s390x, sh) some previously missing syscall
      numbers got added as well.
      f3f96f2d
    • S
      mips64: fix syscall numbers of io_pgetevents and rseq · b574de5b
      Szabolcs Nagy 提交于
      the numbers added in
      
        commit d149e69c
        add io_pgetevents and rseq syscall numbers from linux v4.18
      
      were incorrect.
      b574de5b
  8. 11 4月, 2019 2 次提交
  9. 08 2月, 2019 1 次提交
  10. 10 12月, 2018 1 次提交
  11. 17 10月, 2018 1 次提交
    • R
      make thread-pointer-loading asm non-volatile · a4a3e4db
      Rich Felker 提交于
      this will allow the compiler to cache and reuse the result, meaning we
      no longer have to take care not to load it more than once for the sake
      of archs where the load may be expensive.
      
      depends on commit 1c84c999 for
      correctness, since otherwise the compiler could hoist loads during
      stage 3 of dynamic linking before the initial thread-pointer setup.
      a4a3e4db
  12. 13 9月, 2018 1 次提交
    • R
      apply hidden visibility to sigreturn code fragments · b6e59cd9
      Rich Felker 提交于
      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.
      b6e59cd9
  13. 18 7月, 2018 1 次提交
    • S
      add support for arch-specific ptrace command macros · df6d9450
      Szabolcs Nagy 提交于
      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).
      df6d9450
  14. 27 6月, 2018 1 次提交
  15. 20 6月, 2018 1 次提交
  16. 03 6月, 2018 1 次提交
    • S
      fix TLS layout of TLS variant I when there is a gap above TP · 610c5a85
      Szabolcs Nagy 提交于
      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.
      610c5a85
  17. 11 3月, 2018 1 次提交
    • R
      fix minor namespace issues in termios.h · eb5ae940
      Rich Felker 提交于
      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.
      eb5ae940
  18. 23 2月, 2018 2 次提交
    • S
      add MAP_SYNC and MAP_SHARED_VALIDATE from linux v4.15 · 9b57db3f
      Szabolcs Nagy 提交于
      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*).
      9b57db3f
    • S
      mips,powerpc: fix TIOCSER_TEMT in termios.h · 9eda4dc6
      Szabolcs Nagy 提交于
      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.
      9eda4dc6
  19. 06 11月, 2017 2 次提交
  20. 30 8月, 2017 2 次提交
  21. 01 6月, 2017 2 次提交
    • R
      remove long-obsolete clang workarounds from mips* syscall_arch.h files · 1c497005
      Rich Felker 提交于
      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.
      1c497005
    • R
      fix fstatat syscall on mips64 · 4073f03a
      Rich Felker 提交于
      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.
      4073f03a
  22. 30 12月, 2016 1 次提交
  23. 20 10月, 2016 1 次提交
    • S
      add bits/hwcap.h and include it in sys/auxv.h · fe39aaae
      Szabolcs Nagy 提交于
      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.
      fe39aaae
  24. 14 7月, 2016 1 次提交
  25. 04 7月, 2016 4 次提交