1. 25 1月, 2016 9 次提交
  2. 24 1月, 2016 1 次提交
    • R
      improve aarch64 atomics · b17fbd35
      Rich Felker 提交于
      aarch64 provides ll/sc variants with acquire/release memory order,
      freeing us from the need to have full barriers both before and after
      the ll/sc operation. previously they were not used because the a_cas
      can fail without performing a_sc, in which case half of the barrier
      would be omitted. instead, define a custom version of a_cas for
      aarch64 which uses a_barrier explicitly when aborting the cas
      operation. aside from cas, other operations built on top of ll/sc are
      not affected since they never abort but rather loop until they
      succeed.
      
      a split ll/sc version of the pointer-sized a_cas_p is also introduced
      using the same technique.
      
      patch by Szabolcs Nagy.
      b17fbd35
  3. 22 1月, 2016 15 次提交
    • R
      0f5eb3de
    • R
      remove arch/$(ARCH)/src from the build system · 5a2e8825
      Rich Felker 提交于
      the files that used to come from extra src dirs under the arch dir
      have all been removed or moved to appropriate places under the main
      src tree.
      5a2e8825
    • R
      remove sh port's __fpscr_values source file · 4de1bc11
      Rich Felker 提交于
      commit f3ddd173, the dynamic linker
      bootstrap overhaul, silently disabled the definition of __fpscr_values
      in this file since libc.so's copy of __fpscr_values now comes from
      crt_arch.h, the same place the public definition in the main program's
      crt1.o ultimately comes from. remove this file which is no longer in
      use.
      4de1bc11
    • R
    • R
      230bfe1a
    • 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
      overhaul powerpc atomics for new atomics framework · 513c0436
      Rich Felker 提交于
      previously powerpc had a_cas defined in terms of its native ll/sc
      style operations, but all other atomics were defined in terms of
      a_cas. instead define a_ll and a_sc so the compiler can generate
      optimized versions of all the atomic ops and perform better inlining
      of a_cas.
      
      extracting the result of the sc (stwcx.) instruction is rather awkward
      because it's natively stored in a condition flag, which is not
      representable in inline asm. but even with this limitation the new
      code still seems significantly better.
      513c0436
    • 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
      clean up i386 atomics for new atomics framework · e24984ef
      Rich Felker 提交于
      this commit mostly makes consistent things like spacing, function
      ordering in atomic_arch.h, argument names, use of volatile, etc. the
      fake 64-bit and/or atomics are also removed because the shared
      atomic.h does a better job of implementing them; it avoids making two
      atomic memory accesses when only one 32-bit half needs to be touched.
      
      no major overhaul is needed or possible because x86 actually has
      native versions of all the usual atomic operations, rather than using
      ll/sc or needing cas loops.
      e24984ef
    • R
      overhaul mips atomics for new atomics framework · 369b22f9
      Rich Felker 提交于
      369b22f9
    • R
      move arm-specific translation units out of arch/arm/src, to src/*/arm · e617b9ee
      Rich Felker 提交于
      this is possible with the new build system that allows src/*/$(ARCH)/*
      files which do not shadow a file in the parent directory, and yields a
      more logical organization. eventually it will be possible to remove
      arch/*/src from the build system.
      e617b9ee
    • R
      overhaul arm atomics for new atomics framework · 397f0a6a
      Rich Felker 提交于
      switch to ll/sc model so that new atomic.h can provide optimized
      versions of all the atomic primitives without needing an ll/sc loop
      written in asm for each one.
      
      all isa levels which use ldrex/strex now use the inline ll/sc model
      even if the type of barrier to use is not known until runtime (v6).
      the cas model is only used for arm v5 and earlier, and it has been
      optimized to make the call via inline asm with custom constraints
      rather than as a C function call.
      397f0a6a
    • R
      overhaul aarch64 atomics for new atomics framework · aa0db4b5
      Rich Felker 提交于
      aa0db4b5
    • R
      overhaul sh atomics for new atomics framework, add j-core cas.l backend · 61b1e75f
      Rich Felker 提交于
      sh needs runtime-selected atomic backends since there are a number of
      supported models that use non-forwards-compatible (non-smp-compatible)
      atomic mechanisms. previously, the code paths for this were highly
      inefficient since they involved C function calls with multiple
      branches in the callee and heavy spills in the caller. the new code
      performs calls the runtime-selected asm fragment from inline asm with
      extremely minimal clobbers, rather than using a function call.
      
      for the sh4a case where the atomic mechanism is known and there is no
      forward-compatibility issue, the movli.l and movco.l instructions are
      provided as a_ll and a_sc, allowing the new shared atomic.h to
      generate efficient inline versions of all the basic atomic operations
      without needing a cas loop.
      61b1e75f
    • 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
  4. 21 1月, 2016 2 次提交
  5. 20 1月, 2016 12 次提交
    • R
      simplify "make clean" and remove unneeded lib dir from tree · 4fcc7eb5
      Rich Felker 提交于
      the lib dir is automatically created if needed by the out-of-tree
      build logic, and now that all generated files are in obj and lib,
      deleting them is much simpler. using "rm -rf" is also more thorough,
      as it picks up object files that were left around from source files
      that no longer exist or which are no longer to be used because an
      arch-specific replacement file was added or removed.
      4fcc7eb5
    • R
      deduplicate compiler invocation command line in makefile · ada4798d
      Rich Felker 提交于
      also clean up duplication of CFLAGS passing to assembler.
      ada4798d
    • R
      80de11bc
    • R
      remove support for subarch .sub files from the makefile · 0f814a4e
      Rich Felker 提交于
      as of commit af21a82c, .sub files are
      no longer in use. removing the makefile machinery to handle them not
      only cleans up and simplifies the makefile, but also significantly
      reduces make's startup time.
      0f814a4e
    • R
      fix build regression for arm pre-v7 from out-of-tree build patch · b6363bb7
      Rich Felker 提交于
      commit 2f853dd6 failed to replicate
      the old makefile logic that caused arch/arm/src/arm/atomics.s to be
      built. since this was the only .s file under arch/*/src, rather than
      trying to reproduce the old logic, I'm just moving it up a level and
      adjusting the glob pattern in the makefile to catch it. eventually
      arch/*/src will probably be removed in favor of moving all these files
      to appropriate src/*/$(ARCH) locations.
      b6363bb7
    • R
      af21a82c
    • R
      4b9a08f2
    • R
      fix dynamic linker path file selection for arm vs armhf · 56764601
      Rich Felker 提交于
      the __SOFTFP__ macro which was wrongly being used does not reflect the
      ABI (arm vs armhf) but just the availability of floating point
      instructions/registers, so -mfloat-abi=softfp was wrongly being
      treated as armhf. __ARM_PCS_VFP is the correct predefined macro to
      check for the armhf EABI variant. this macro usage was corrected for
      the build process in commit 4918c2bb
      but reloc.h was apparently overlooked at the time.
      56764601
    • R
      replace armhf math asm source files with inline asm · e4355bd6
      Rich Felker 提交于
      this makes it possible to inline them with LTO, and is the simplest
      approach to eliminating the use of .sub files.
      
      this also makes VFP sqrt available for use with the standard EABI
      (plain arm rather than armhf subarch) when libc is built with
      -mfloat-abi=softfp. the same could have been done for fabs, but when
      the argument and return value are in integer registers, moving to VFP
      registers and back is almost certainly more costly than a simple
      integer operation.
      e4355bd6
    • R
      adapt build of arm memcpy asm not to use .sub files · cb1875eb
      Rich Felker 提交于
      this depends on commit 9f5eb779, which
      made it possible to use a .c file for arch-specific replacements, and on
      commit 2f853dd6, the out-of-tree build
      support, which made it so that src/*/$(ARCH)/* 'replacement' files get
      used even if they don't match the base name of a .c file in the parent
      directory.
      cb1875eb
    • R
      eliminate separate static/shared CFLAGS vars in makefile · 9514e70c
      Rich Felker 提交于
      this allows the rules for .o and .lo files to be identical, with -fPIC
      and -DSHARED added for .lo files via target-specific variable append.
      this is arguably cleaner now and will allow more cleanup and removal
      of redundant rule bodies after other prerequisite changes are made.
      9514e70c
    • R
      add support for arch-provided replacement files as .c or .S · 9f5eb779
      Rich Felker 提交于
      previously, replacement files provided in $(ARCH) dirs under src/ had
      to be .s files. in order to replace a file with C source, an empty .s
      file was needed there to suppress the original file, and a separate .c
      file was needed in arch/$(ARCH)/src/.
      
      support for .S is new and is aimed at short-term use eliminating .sub
      files. asm source files are still expected not to make any heavy
      preprocessor use, just simple conditionals on subarch. eventually most
      affected files may be replaced with C source files with minimal inline
      asm instead of asm source files.
      9f5eb779
  6. 18 1月, 2016 1 次提交
    • K
      netinet/tcp: Add TCPOPT, TCPOLEN constants · 53f41fb5
      Kylie McClain 提交于
      Programs such as iptables depend on these constants, which can also
      be found defined in other libcs.
      
      Since only TCP_* is reserved as part of tcp.h's namespace, we hide
      them behind _BSD_SOURCE (and therefore _DEFAULT_SOURCE) to expose
      them by default, but keep it standard conforming.
      53f41fb5