about summary refs log tree commit diff
path: root/arch/powerpc/atomic.h
Commit message (Collapse)AuthorAgeFilesLines
* refactor internal atomic.hRich Felker2016-01-211-126/+0
| | | | | | | | | | | | | | | 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.
* add explicit barrier operation to internal atomic.h APIRich Felker2014-10-101-1/+3
|
* add working a_spin() atomic for non-x86 targetsRich Felker2014-08-251-0/+1
| | | | | | | | | | | | | conceptually, a_spin needs to be at least a compiler barrier, so the compiler will not optimize out loops (and the load on each iteration) while spinning. it should also be a memory barrier, or the spinning thread might keep spinning without noticing stores from other threads, thus delaying for longer than it should. ideally, an optimal a_spin implementation that avoids unnecessary cache/memory contention should be chosen for each arch, but for now, the easiest thing is to perform a useless a_cas on the calling thread's stack.
* clean up unused and inconsistent atomics in arch dirsRich Felker2014-07-271-6/+0
| | | | | | | | | | | the a_cas_l, a_swap_l, a_swap_p, and a_store_l operations were probably used a long time ago when only i386 and x86_64 were supported. as other archs were added, support for them was inconsistent, and they are obviously not in use at present. having them around potentially confuses readers working on new ports, and the type-punning hacks and inconsistent use of types in their definitions is not a style I wish to perpetuate in the source tree, so removing them seems appropriate.
* fix missing barriers in powerpc atomic storeRich Felker2014-07-191-1/+5
|
* fix missing barrier instructions in powerpc atomic asmRich Felker2014-07-191-1/+4
|
* fix build breakage from ppc asm constraints changeRich Felker2014-07-191-3/+3
| | | | | | | | | | | | due to a mistake in my testing procedure, the changes in the previous commit were not correctly tested and wrongly assumed to be valid. the lwarx and stwcx. instructions do not accept general ppc memory address expressions and thus the argument associated with the memory constraint cannot be used directly. instead, the memory constraint can be left as an argument that the asm does not actually use, and the address can be provided in a separate register constraint.
* fix broken constraints for powerpc atomic cas asmRich Felker2014-07-191-1/+1
| | | | | | | | the register constraint for the address to be accessed did not convey that the asm can access the pointed-to object. as far as the compiler could tell, the result of the asm was just a pure function of the address and the values passed in, and thus the asm could be hoisted out of loops or omitted entirely if the result was not used.
* add missing a_or_l to atomic.h for non-x86 archsRich Felker2013-08-111-0/+5
| | | | this is needed for recently committed sigaction code
* fix powerpc atomic compare-and-swap functionRich Felker2012-11-141-6/+7
| | | | | previous version did not compare at all; it was just a fancy atomic write. untested. further atomic fixes may be needed.
* update ppc atomic code to match the endian-agnostic version on other archsRich Felker2012-11-141-14/+6
|
* PPC port cleaned up, static linking works well now.rofl0r2012-11-131-0/+124