1. 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
  2. 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
  3. 20 4月, 2018 1 次提交
    • A
      remove a_ctz_l from arch specific atomic_arch.h · 0c6abb58
      Andre McCurdy 提交于
      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.
      0c6abb58
  4. 11 3月, 2018 2 次提交
  5. 15 12月, 2017 1 次提交
  6. 06 11月, 2017 1 次提交
  7. 30 8月, 2017 1 次提交
    • S
      add a_clz_64 helper function · 06fbefd1
      Szabolcs Nagy 提交于
      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.
      06fbefd1
  8. 13 1月, 2017 1 次提交
    • R
      fix crashes in x32 __tls_get_addr · 1f53e7d0
      rofl0r 提交于
      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.
      1f53e7d0
  9. 05 1月, 2017 1 次提交
    • R
      reduce impact of REG_* namespace pollution in x86[_64] signal.h · 150747b4
      Rich Felker 提交于
      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
      150747b4
  10. 30 12月, 2016 1 次提交
  11. 13 11月, 2016 1 次提交
    • R
      work around gdb issues recognizing sigreturn trampoline on x86_64 · 54991729
      Rich Felker 提交于
      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.
      54991729
  12. 20 10月, 2016 1 次提交
  13. 04 7月, 2016 3 次提交
  14. 10 6月, 2016 1 次提交
    • S
      add preadv2 and pwritev2 syscall numbers for linux v4.6 · 78b1f3cb
      Szabolcs Nagy 提交于
      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.
      78b1f3cb
  15. 12 5月, 2016 3 次提交
  16. 30 3月, 2016 1 次提交
  17. 19 3月, 2016 2 次提交
    • S
      add copy_file_range syscall numbers from linux v4.5 · 84d4f5ee
      Szabolcs Nagy 提交于
      it was introduced for offloading copying between regular files
      in linux commit 29732938a6289a15e907da234d6692a2ead71855
      
      (microblaze and sh does not yet have the syscall number.)
      84d4f5ee
    • S
      deduplicate bits/mman.h · e9f1c798
      Szabolcs Nagy 提交于
      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.
      e9f1c798
  18. 28 1月, 2016 1 次提交
    • R
      deduplicate the bulk of the arch bits headers · 4dfac115
      Rich Felker 提交于
      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.
      4dfac115
  19. 27 1月, 2016 3 次提交
    • S
      add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flags · 789ff6a9
      Szabolcs Nagy 提交于
      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
      789ff6a9
    • S
      add mlock2 syscall number from linux v4.4 · 51d5f139
      Szabolcs Nagy 提交于
      this is mlock with a flags argument, new in linux commit
      a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e
      
      as usual microblaze and sh don't have allocated syscall number yet.
      51d5f139
    • S
      add new membarrier, userfaultfd and switch_endian syscalls · 09001a8f
      Szabolcs Nagy 提交于
      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
      09001a8f
  20. 22 1月, 2016 3 次提交
    • R
      move x32 sysinfo impl and syscall fixup code out of arch/x32/src · 66215afc
      Rich Felker 提交于
      all such arch-specific translation units are being moved to
      appropriate arch dirs under the main src tree.
      66215afc
    • R
      clean up x86_64 (and x32) atomics for new atomics framework · 16b55298
      Rich Felker 提交于
      this commit mostly makes consistent things like spacing, function
      ordering in atomic_arch.h, argument names, use of volatile, etc.
      a_ctz_l was also removed from x86_64 since atomic.h provides it
      automatically using a_ctz_64.
      16b55298
    • R
      refactor internal atomic.h · 1315596b
      Rich Felker 提交于
      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.
      1315596b
  21. 16 12月, 2015 1 次提交
  22. 03 11月, 2015 1 次提交
    • R
      properly access mcontext_t program counter in cancellation handler · cb1bf2f3
      Rich Felker 提交于
      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.
      cb1bf2f3
  23. 17 9月, 2015 1 次提交
  24. 17 8月, 2015 1 次提交
    • R
      mitigate performance regression in libc-internal locks on x86_64 · 5a9c8c05
      Rich Felker 提交于
      commit 3c43c076 fixed missing
      synchronization in the atomic store operation for i386 and x86_64, but
      opted to use mfence for the barrier on x86_64 where it's always
      available. however, in practice mfence is significantly slower than
      the barrier approach used on i386 (a nop-like lock orl operation).
      this commit changes x86_64 (and x32) to use the faster barrier.
      5a9c8c05
  25. 29 7月, 2015 1 次提交
    • R
      fix missing synchronization in atomic store on i386 and x86_64 · 3c43c076
      Rich Felker 提交于
      despite being strongly ordered, the x86 memory model does not preclude
      reordering of loads across earlier stores. while a plain store
      suffices as a release barrier, we actually need a full barrier, since
      users of a_store subsequently load a waiter count to determine whether
      to issue a futex wait, and using a stale count will result in soft
      (fail-to-wake) deadlocks. these deadlocks were observed in malloc and
      possible with stdio locks and other libc-internal locking.
      
      on i386, an atomic operation on the caller's stack is used as the
      barrier rather than performing the store itself using xchg; this
      avoids the need to read the cache line on which the store is being
      performed. mfence is used on x86_64 where it's always available, and
      could be used on i386 with the appropriate cpu model checks if it's
      shown to perform better.
      3c43c076
  26. 20 5月, 2015 1 次提交
  27. 07 5月, 2015 1 次提交
    • R
      fix stack protector crashes on x32 & powerpc due to misplaced TLS canary · 484194db
      Rich Felker 提交于
      i386, x86_64, x32, and powerpc all use TLS for stack protector canary
      values in the default stack protector ABI, but the location only
      matched the ABI on i386 and x86_64. on x32, the expected location for
      the canary contained the tid, thus producing spurious mismatches
      (resulting in process termination) upon fork. on powerpc, the expected
      location contained the stdio_locks list head, so returning from a
      function after calling flockfile produced spurious mismatches. in both
      cases, the random canary was not present, and a predictable value was
      used instead, making the stack protector hardening much less effective
      than it should be.
      
      in the current fix, the thread structure has been expanded to have
      canary fields at all three possible locations, and archs that use a
      non-default location must define a macro in pthread_arch.h to choose
      which location is used. for most archs (which lack TLS canary ABI) the
      choice does not matter.
      484194db
  28. 03 5月, 2015 1 次提交
  29. 02 5月, 2015 1 次提交
  30. 21 4月, 2015 1 次提交