/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_atomic.rsh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 The Android Open Source Project
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00023 #ifndef __RS_ATOMIC_RSH__
00024 #define __RS_ATOMIC_RSH__
00025 
00026 #if (defined(RS_VERSION) && (RS_VERSION >= 14))
00027 
00036 extern int32_t __attribute__((overloadable))
00037     rsAtomicInc(volatile int32_t* addr);
00046 extern uint32_t __attribute__((overloadable))
00047     rsAtomicInc(volatile uint32_t* addr);
00048 
00056 extern int32_t __attribute__((overloadable))
00057     rsAtomicDec(volatile int32_t* addr);
00065 extern uint32_t __attribute__((overloadable))
00066     rsAtomicDec(volatile uint32_t* addr);
00067 
00076 extern int32_t __attribute__((overloadable))
00077     rsAtomicAdd(volatile int32_t* addr, int32_t value);
00086 extern uint32_t __attribute__((overloadable))
00087     rsAtomicAdd(volatile uint32_t* addr, uint32_t value);
00088 
00097 extern int32_t __attribute__((overloadable))
00098     rsAtomicSub(volatile int32_t* addr, int32_t value);
00107 extern uint32_t __attribute__((overloadable))
00108     rsAtomicSub(volatile uint32_t* addr, uint32_t value);
00109 
00118 extern int32_t __attribute__((overloadable))
00119     rsAtomicAnd(volatile int32_t* addr, int32_t value);
00128 extern uint32_t __attribute__((overloadable))
00129     rsAtomicAnd(volatile uint32_t* addr, uint32_t value);
00130 
00139 extern int32_t __attribute__((overloadable))
00140     rsAtomicOr(volatile int32_t* addr, int32_t value);
00149 extern uint32_t __attribute__((overloadable))
00150     rsAtomicOr(volatile uint32_t* addr, uint32_t value);
00151 
00160 extern uint32_t __attribute__((overloadable))
00161     rsAtomicXor(volatile uint32_t* addr, uint32_t value);
00170 extern int32_t __attribute__((overloadable))
00171     rsAtomicXor(volatile int32_t* addr, int32_t value);
00172 
00182 extern uint32_t __attribute__((overloadable))
00183     rsAtomicMin(volatile uint32_t* addr, uint32_t value);
00193 extern int32_t __attribute__((overloadable))
00194     rsAtomicMin(volatile int32_t* addr, int32_t value);
00195 
00205 extern uint32_t __attribute__((overloadable))
00206     rsAtomicMax(volatile uint32_t* addr, uint32_t value);
00216 extern int32_t __attribute__((overloadable))
00217     rsAtomicMax(volatile int32_t* addr, int32_t value);
00218 
00230 extern int32_t __attribute__((overloadable))
00231     rsAtomicCas(volatile int32_t* addr, int32_t compareValue, int32_t newValue);
00232 
00244 extern uint32_t __attribute__((overloadable))
00245     rsAtomicCas(volatile uint32_t* addr, int32_t compareValue, int32_t newValue);
00246 
00247 #endif //defined(RS_VERSION) && (RS_VERSION >= 14)
00248 
00249 #endif
00250