My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

armv6_atomic.h


Designed for

ARMV6, ARMV7 (ex Cortex-A8) atomic primitives written for BADA and gcc will work also on IPhone and Android. Functions are written as templates so will be able to handle any combination of POD!(yes even structs!) types of sizes 1, 2, 4 and 8 bytes in size.


Use this as include:

#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6T2_) 
 || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_7__)|| defined(__ARM_ARCH_7A__)
#include "armv6_atomic.h"
#endif

Supported functionality:

Function Type
sync_synchronize data memory barier
cpu_yield issues CPU yield instruction
sync_bool_compare_and_swap atomic compare and swap
sync_lock_test_and_set atomic swap
sync_fetch_and_add atomic fetch add store and return old value
sync_add_and_fetch atomic fetch add store and return new value
sync_fetch_and_sub atomic fetch sub store and return old value
sync_sub_and_fetch atomic fetch sub store and return new value
sync_increment_and_fetch atomic fetch increment store and return old value
sync_decrement_and_fetch atomic fetch increment store and return new value
sync_fetch_and_increment atomic fetch decrement store and return old value
sync_fetch_and_decrement atomic fetch decrement store and return new value

Powered by Google Project Hosting