Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

atomic.h

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #ifndef ATOMIC_H
00012 #define ATOMIC_H
00013 
00014 #define acquire_lock(lock, val)         ({ (lock) = (val); })
00015 #define acquire_lock_no_ien(lock, val)  ({ (lock) = (val); })
00016 #define release_lock(lock, ien)         ({ (lock) = 0; })
00017 #define release_lock_no_ien(lock)       ({ (lock) = 0; })
00018 
00019 #define atomic_add(var, val)    ({ int t = (var); (var) += (val); t; })
00020 #define atomic_sub(var, val)    ({ int t = (var); (var) -= (val); t; })
00021 #define atomic_or(var, val)     ({ int t = (var); (var) |= (val); t; })
00022 #define atomic_addi(var, val)   ({ int t = (var); (var) += (val); t; })
00023 #define atomic_subi(var, val)   ({ int t = (var); (var) -= (val); t; })
00024 #define atomic_srl(var, val)    ({ int t = (var); (var) >>= (val); t; })
00025 #define atomic_sll(var, val)    ({ int t = (var); (var) <<= (val); t; })
00026 #define atomic_set(var, val)    ({ int t = (var); (var) = (val); t; })
00027 #define atomic_seti(var, val)   ({ int t = (var); (var) = (val); t; })
00028 
00029 #endif

Generated on Wed Feb 15 14:52:38 2006 for yapi by doxygen 1.3.2