]> git.sesse.net Git - casparcg/blob - tbb30_20100406oss/include/tbb/machine/ibm_aix51.h
ff3103b1fcb5de9d5d6e52d99b484929ed18cd00
[casparcg] / tbb30_20100406oss / include / tbb / machine / ibm_aix51.h
1 /*
2     Copyright 2005-2010 Intel Corporation.  All Rights Reserved.
3
4     This file is part of Threading Building Blocks.
5
6     Threading Building Blocks is free software; you can redistribute it
7     and/or modify it under the terms of the GNU General Public License
8     version 2 as published by the Free Software Foundation.
9
10     Threading Building Blocks is distributed in the hope that it will be
11     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with Threading Building Blocks; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
19     As a special exception, you may use this file as part of a free software
20     library without restriction.  Specifically, if other files instantiate
21     templates or use macros or inline functions from this file, or you compile
22     this file and link it with other files to produce an executable, this
23     file does not by itself cause the resulting executable to be covered by
24     the GNU General Public License.  This exception does not however
25     invalidate any other reasons why the executable file might be covered by
26     the GNU General Public License.
27 */
28
29 #ifndef __TBB_machine_H
30 #error Do not include this file directly; include tbb_machine.h instead
31 #endif
32
33 #define __TBB_WORDSIZE 8
34 #define __TBB_BIG_ENDIAN 1
35
36 #include <stdint.h>
37 #include <unistd.h>
38 #include <sched.h>
39
40 extern "C" {
41
42 int32_t __TBB_machine_cas_32 (volatile void* ptr, int32_t value, int32_t comparand);
43 int64_t __TBB_machine_cas_64 (volatile void* ptr, int64_t value, int64_t comparand);
44 #define __TBB_fence_for_acquire() __TBB_machine_flush ()
45 #define __TBB_fence_for_release() __TBB_machine_flush ()
46
47 }
48
49 #define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cas_32(P,V,C)
50 #define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cas_64(P,V,C)
51 #define __TBB_CompareAndSwapW(P,V,C) __TBB_machine_cas_64(P,V,C)
52 #define __TBB_Yield() sched_yield()