atomics.h

Go to the documentation of this file.
00001 /*
00002         libthreads - a threading API for Wii
00003 
00004 Copyright (C) 2011              Alex Marshall <trap15@raidenii.net>
00005 
00006 # This code is licensed to you under the terms of the GNU GPL, version 2;
00007 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
00008 */
00009 
00014 #ifndef __ATOMICS_H__
00015 #define __ATOMICS_H__
00016 
00018 typedef enum {
00019         ATOMIC_COMPARE_NONE = 0, 
00020         ATOMIC_COMPARE_ZERO, 
00021         ATOMIC_COMPARE_NEGATIVE, 
00022 } atomic_compare_t;
00023 
00029 u32 atomics_read(u32* v);
00035 void atomics_set(u32* v, u32 i);
00043 int atomics_add(u32* v, u32 i, atomic_compare_t cmp);
00051 int atomics_sub(u32* v, u32 i, atomic_compare_t cmp);
00058 int atomics_inc(u32* v, atomic_compare_t cmp);
00065 int atomics_dec(u32* v, atomic_compare_t cmp);
00072 int atomics_bitset(u32* v, u32 bit);
00079 int atomics_bitclear(u32* v, u32 bit);
00086 int atomics_bitchange(u32* v, u32 bit);
00093 int atomics_bitcheck(u32* v, u32 bit);
00094 
00095 #endif
00096 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3