summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include/atomic.h
Commit message (Collapse)AuthorAgeFilesLines
* Define mb(), rmb() and wmb() for real.marcel2008-11-221-3/+3
|
* - bump __FreeBSD version to reflect added buf_ring, memory barriers,kmacy2008-11-221-0/+4
| | | | | | | | | | | | | | | | | and ifnet functions - add memory barriers to <machine/atomic.h> - update drivers to only conditionally define their own - add lockless producer / consumer ring buffer - remove ring buffer implementation from cxgb and update its callers - add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to allow drivers to efficiently manage multiple hardware queues (i.e. not serialize all packets through one ifq) - expose if_qflush to allow drivers to flush any driver managed queues This work was supported by Bitgravity Inc. and Chelsio Inc.
* Work-around a compiler optimization bug, that broke libthr. Massivemarcel2008-05-281-1/+1
| | | | | | | | | | | | | | | | inlining resulted in constant propagation to the extend that cmpval was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U). Unfortunately, instead of zero-extending the unsigned constant, it was sign-extended. As such, the cmpxchg instruction was comparing 0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't perform the exchange. But, since the value returned by cmpxhg equalled cmpval (when zero- extended), the _thr_rtld_lock_release() function thought the exchange did happen and as such returned as if having released the lock. This was not the case. Subsequent locking requests found rw_state non-zero and the thread in question entered the kernel and block indefinitely. The work-around is to zero-extend by casting to uint64_t.
* Implement atomic_fetchadd_long() for all architectures and document it.pjd2008-03-161-0/+11
| | | | Reviewed by: attilio, jhb, jeff, kris (as a part of the uidinfo_waitfree.patch)
* Define atomic_readandclear_ptr.jasone2007-11-271-0/+1
|
* Add casts to some of the more commonly used pointer-type atomicmarcel2007-07-301-5/+14
| | | | | | | operations. We really should be able to make those inline functions, but this would break its use for sx_locks. Approved by: re (blanket)
* Add a new atomic_fetchadd() primitive that atomically adds a value to ajhb2005-09-271-0/+19
| | | | | | | | | variable and returns the previous value of the variable. Tested on: i386, alpha, sparc64, arm (cognet) Reviewed by: arch@ Submitted by: cognet (arm) MFC after: 1 week
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-07-151-58/+19
| | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm
* For the atomic_{add|clear|set|subtract} family of inlines, return themarcel2004-09-221-2/+4
| | | | | | old or previous value instead of void. This is not as is documented in atomic(9), but is API (and ABI) compatible and simply makes sense. This feature will primarily be used for atomic PTE updates in PMAP/ng.
* MFp4: various style fixes, includingmarcel2004-09-221-248/+239
| | | | | | | | o s/u_int/uint/g o s/#define<sp>/#define<tab>/g o indent macro definitions o Improve vertical spacing o Globally align line continuation character
* Simplify IA64_CMPXCHG to avoid having braced-groups in expressions.marcel2002-05-191-20/+22
| | | | | | | | | As a minor positive side-effect, code at -O0 is more optimal. As a minor negative side-effect, certain boundary cases yield no better code than non-boundary cases. For example, atomic_set_acq_32(p, 0) does a useless logical OR with value 0. This was previously elimina- ted as part of if/while optimizations. Non-boundary cases yield identical code at -O1 and -O2.
* Implement atomic_{set,clear,add,subtract}_{acq_,rel_,}_ptr()jhb2000-10-251-12/+26
|
* * Various fixes to breakage introduced by the atomic and mutex reorgs.dfr2000-10-241-9/+21
| | | | | | | * Fixes to the signal delivery code. Not quite right yet. I would have preferred to wait until I have signal delivery actually working but the current kernel in CVS doesn't build.
* - Expand the set of atomic operations to optionally include memory barriersjhb2000-10-201-57/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | in most of the atomic operations. Now for these operations, you can use the normal atomic operation, you can use the operation with a read barrier, or you can use the operation with a write barrier. The function names follow the same semantics used in the ia64 instruction set. An atomic operation with a read barrier has the extra suffix 'acq', due to it having "acquire" semantics. An atomic operation with a write barrier has the extra suffix 'rel'. These suffixes are inserted between the name of the operation to perform and the typename. For example, the atomic_add_int() function now has 3 variants: - atomic_add_int() - this is the same as the previous function - atomic_add_acq_int() - this function combines the add operation with a read memory barrier - atomic_add_rel_int() - this function combines the add operation with a write memory barrier - Add 'ptr' to the list of types that we can perform atomic operations on. This allows one to do atomic operations on uintptr_t's. This is useful in the mutex code, for example, because the actual mutex lock is a pointer. - Add two new operations for doing loads and stores with memory barriers. The new load operations use a read barrier before the load, and the new store operations use a write barrier after the load. For example, atomic_load_acq_int() will atomically load an integer as well as enforcing a read barrier.
* * Add rudimentary DDB support (no kgdb, no backtrace, no single step).dfr2000-10-101-0/+23
| | | | | | * Track recent changes to SWI code. * Allocate RIDs for pmaps (untested). * Implement assembler version of cpu_switch - its cleaner that way.
* This is the first snapshot of the FreeBSD/ia64 kernel. This kernel willdfr2000-09-291-0/+190
not work on any real hardware (or fully work on any simulator). Much more needs to happen before this is actually functional but its nice to see the FreeBSD copyright message appear in the ia64 simulator.
OpenPOWER on IntegriCloud