1. 07 12月, 2012 3 次提交
  2. 24 11月, 2012 1 次提交
  3. 19 11月, 2012 2 次提交
    • R
      powerpc: handle syscall error in clone. · 3fae236e
      rofl0r 提交于
      sigsetjmp: store temporaries in jmp_buf rather than on stack.
      3fae236e
    • R
      fix powerpc asm not to store data in volatile space below stack pointer · 9565a349
      Rich Felker 提交于
      it's essential to decrement the stack pointer before writing to new
      stack space, rather than afterwards. otherwise there is a race
      condition during which asynchronous code (signals) could clobber the
      data being stored.
      
      it may be possible to optimize the code further using stwu, but I
      wanted to avoid making any changes to the actual stack layout in this
      commit. further improvements can be made separately if desired.
      9565a349
  4. 15 11月, 2012 1 次提交
  5. 14 11月, 2012 2 次提交
  6. 09 11月, 2012 1 次提交
    • R
      clean up sloppy nested inclusion from pthread_impl.h · efd4d87a
      Rich Felker 提交于
      this mirrors the stdio_impl.h cleanup. one header which is not
      strictly needed, errno.h, is left in pthread_impl.h, because since
      pthread functions return their error codes rather than using errno,
      nearly every single pthread function needs the errno constants.
      
      in a few places, rather than bringing in string.h to use memset, the
      memset was replaced by direct assignment. this seems to generate much
      better code anyway, and makes many functions which were previously
      non-leaf functions into leaf functions (possibly eliminating a great
      deal of bloat on some platforms where non-leaf functions require ugly
      prologue and/or epilogue).
      efd4d87a
  7. 18 10月, 2012 2 次提交
  8. 12 10月, 2012 1 次提交
  9. 29 9月, 2012 1 次提交
    • R
      microblaze port · 8c0a3d9e
      Rich Felker 提交于
      based on initial work by rdp, with heavy modifications. some features
      including threads are untested because qemu app-level emulation seems
      to be broken and I do not have a proper system image for testing.
      8c0a3d9e
  10. 07 9月, 2012 2 次提交
    • R
      further use of _Noreturn, for non-plain-C functions · 0c05bd3a
      Rich Felker 提交于
      note that POSIX does not specify these functions as _Noreturn, because
      POSIX is aligned with C99, not the new C11 standard. when POSIX is
      eventually updated to C11, it will almost surely give these functions
      the _Noreturn attribute. for now, the actual _Noreturn keyword is not
      used anyway when compiling with a c99 compiler, which is what POSIX
      requires; the GCC __attribute__ is used instead if it's available,
      however.
      
      in a few places, I've added infinite for loops at the end of _Noreturn
      functions to silence compiler warnings. presumably
      __buildin_unreachable could achieve the same thing, but it would only
      work on newer GCCs and would not be portable. the loops should have
      near-zero code size cost anyway.
      
      like the previous _Noreturn commit, this one is based on patches
      contributed by philomath.
      0c05bd3a
    • R
      use restrict everywhere it's required by c99 and/or posix 2008 · 400c5e5c
      Rich Felker 提交于
      to deal with the fact that the public headers may be used with pre-c99
      compilers, __restrict is used in place of restrict, and defined
      appropriately for any supported compiler. we also avoid the form
      [restrict] since older versions of gcc rejected it due to a bug in the
      original c99 standard, and instead use the form *restrict.
      400c5e5c
  11. 10 8月, 2012 1 次提交
    • R
      fix (hopefully) all hard-coded 8's for kernel sigset_t size · 2f437040
      Rich Felker 提交于
      some minor changes to how hard-coded sets for thread-related purposes
      are handled were also needed, since the old object sizes were not
      necessarily sufficient. things have gotten a bit ugly in this area,
      and i think a cleanup is in order at some point, but for now the goal
      is just to get the code working on all supported archs including mips,
      which was badly broken by linux rejecting syscalls with the wrong
      sigset_t size.
      2f437040
  12. 13 7月, 2012 1 次提交
  13. 11 7月, 2012 3 次提交
  14. 04 7月, 2012 1 次提交
    • R
      jmp_buf overhaul fixing several issues · d6c0efe1
      Rich Felker 提交于
      on arm, the location of the saved-signal-mask flag and mask were off
      by one between sigsetjmp and siglongjmp, causing incorrect behavior
      restoring the signal mask. this is because the siglongjmp code assumed
      an extra slot was in the non-sig jmp_buf for the flag, but arm did not
      have this. now, the extra slot is removed for all archs since it was
      useless.
      
      also, arm eabi requires jmp_buf to have 8-byte alignment. we achieve
      that using long long as the type rather than with non-portable gcc
      attribute tags.
      d6c0efe1
  15. 03 7月, 2012 1 次提交
    • R
      fix sigsetjmp on arm (needs asm) · e6129e6d
      Rich Felker 提交于
      no idea why gcc refuses to compile the C code to use a tail call, but
      it's best to use asm anyway so we don't have to rely on the quality of
      the compiler's optimizations for correct code.
      e6129e6d
  16. 05 5月, 2012 1 次提交
    • R
      update license of njk contributed code (x86_64 asm) · 8cfbc8be
      Rich Felker 提交于
      these changes are based on the following communication via email:
      
      "I hereby grant that all of the code I have contributed to musl on or
      before April 23, 2012 may be licensed under the terms of the following
      MIT license:
      
      Copyright (c) 2011-2012 Nicholas J. Kain
      
      Permission is hereby granted, free of charge, to any person obtaining
      a copy of this software and associated documentation files (the
      "Software"), to deal in the Software without restriction, including
      without limitation the rights to use, copy, modify, merge, publish,
      distribute, sublicense, and/or sell copies of the Software, and to
      permit persons to whom the Software is furnished to do so, subject to
      the following conditions:
      
      The above copyright notice and this permission notice shall be
      included in all copies or substantial portions of the Software.
      
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
      8cfbc8be
  17. 28 2月, 2012 1 次提交
    • R
      work around "signal loses thread pointer" issue with "approach 2" · dac084a4
      Rich Felker 提交于
      this was discussed on the mailing list and no consensus on the
      preferred solution was reached, so in anticipation of a release, i'm
      just committing a minimally-invasive solution that avoids the problem
      by ensuring that multi-threaded-capable programs will always have
      initialized the thread pointer before any signal handler can run.
      
      in the long term we may switch to initializing the thread pointer at
      program start time whenever the program has the potential to access
      any per-thread data.
      dac084a4
  18. 19 9月, 2011 1 次提交
    • R
      initial commit of the arm port · d960d4f2
      Rich Felker 提交于
      this port assumes eabi calling conventions, eabi linux syscall
      convention, and presence of the kernel helpers at 0xffff0f?0 needed
      for threads support. otherwise it makes very few assumptions, and the
      code should work even on armv4 without thumb support, as well as on
      systems with thumb interworking. the bits headers declare this a
      little endian system, but as far as i can tell the code should work
      equally well on big endian.
      
      some small details are probably broken; so far, testing has been
      limited to qemu/aboriginal linux.
      d960d4f2
  19. 17 9月, 2011 1 次提交
  20. 12 9月, 2011 1 次提交
  21. 03 9月, 2011 1 次提交
  22. 05 8月, 2011 1 次提交
    • R
      fix off-by-one bug in siglongjmp that caused unpredictable behavior · 338b663d
      Rich Felker 提交于
      if saved, signal mask would not be restored unless some low signals
      were masked. if not saved, signal mask could be wrongly restored to
      uninitialized values. in any, wrong mask would be restored.
      
      i believe this function was written for a very old version of the
      jmp_buf structure which did not contain a final 0 field for
      compatibility with siglongjmp, and never updated...
      338b663d
  23. 31 7月, 2011 2 次提交
    • R
      fix race condition in sigqueue · 07827d1a
      Rich Felker 提交于
      this race is fundamentally due to linux's bogus requirement that
      userspace, rather than kernelspace, fill in the siginfo structure. an
      intervening signal handler that calls fork could cause both the parent
      and child process to send signals claiming to be from the parent,
      which could in turn have harmful effects depending on what the
      recipient does with the signal. we simply block all signals for the
      interval between getuid and sigqueue syscalls (much like what raise()
      does already) to prevent the race and make the getuid/sigqueue pair
      atomic.
      
      this will be a non-issue if linux is fixed to validate the siginfo
      structure or fill it in from kernelspace.
      07827d1a
    • R
      clean up pthread_sigmask/sigprocmask dependency order · ad588184
      Rich Felker 提交于
      it's nicer for the function that doesn't use errno to be independent,
      and have the other one call it. saves some time and avoids clobbering
      errno.
      ad588184
  24. 15 6月, 2011 1 次提交
  25. 14 6月, 2011 1 次提交
  26. 09 6月, 2011 1 次提交
  27. 08 5月, 2011 1 次提交
    • R
      overhaul implementation-internal signal protections · 99b8a25e
      Rich Felker 提交于
      the new approach relies on the fact that the only ways to create
      sigset_t objects without invoking UB are to use the sig*set()
      functions, or from the masks returned by sigprocmask, sigaction, etc.
      or in the ucontext_t argument to a signal handler. thus, as long as
      sigfillset and sigaddset avoid adding the "protected" signals, there
      is no way the application will ever obtain a sigset_t including these
      bits, and thus no need to add the overhead of checking/clearing them
      when sigprocmask or sigaction is called.
      
      note that the old code actually *failed* to remove the bits from
      sa_mask when sigaction was called.
      
      the new implementations are also significantly smaller, simpler, and
      faster due to ignoring the useless "GNU HURD signals" 65-1024, which
      are not used and, if there's any sanity in the world, never will be
      used.
      99b8a25e
  28. 17 4月, 2011 1 次提交
    • R
      overhaul pthread cancellation · feee9890
      Rich Felker 提交于
      this patch improves the correctness, simplicity, and size of
      cancellation-related code. modulo any small errors, it should now be
      completely conformant, safe, and resource-leak free.
      
      the notion of entering and exiting cancellation-point context has been
      completely eliminated and replaced with alternative syscall assembly
      code for cancellable syscalls. the assembly is responsible for setting
      up execution context information (stack pointer and address of the
      syscall instruction) which the cancellation signal handler can use to
      determine whether the interrupted code was in a cancellable state.
      
      these changes eliminate race conditions in the previous generation of
      cancellation handling code (whereby a cancellation request received
      just prior to the syscall would not be processed, leaving the syscall
      to block, potentially indefinitely), and remedy an issue where
      non-cancellable syscalls made from signal handlers became cancellable
      if the signal handler interrupted a cancellation point.
      
      x86_64 asm is untested and may need a second try to get it right.
      feee9890
  29. 15 4月, 2011 1 次提交
  30. 08 4月, 2011 1 次提交
  31. 07 4月, 2011 1 次提交