2 Copyright 2005-2011 Intel Corporation. All Rights Reserved.
4 This file is part of Threading Building Blocks.
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.
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.
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
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.
29 // TODO: revise by comparing with mac_ppc.h
31 #if !defined(__TBB_machine_H) || defined(__TBB_machine_ibm_aix51_H)
32 #error Do not include this file directly; include tbb_machine.h instead
35 #define __TBB_machine_ibm_aix51_H
37 #define __TBB_WORDSIZE 8
38 #define __TBB_BIG_ENDIAN 1
45 int32_t __TBB_machine_cas_32 (volatile void* ptr, int32_t value, int32_t comparand);
46 int64_t __TBB_machine_cas_64 (volatile void* ptr, int64_t value, int64_t comparand);
47 void __TBB_machine_flush ();
48 void __TBB_machine_lwsync ();
49 void __TBB_machine_isync ();
52 // Mapping of old entry point names retained for the sake of backward binary compatibility
53 #define __TBB_machine_cmpswp4 __TBB_machine_cas_32
54 #define __TBB_machine_cmpswp8 __TBB_machine_cas_64
56 #define __TBB_Yield() sched_yield()
58 #define __TBB_USE_GENERIC_PART_WORD_CAS 1
59 #define __TBB_USE_GENERIC_FETCH_ADD 1
60 #define __TBB_USE_GENERIC_FETCH_STORE 1
61 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
62 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
65 #define __TBB_control_consistency_helper() __asm__ __volatile__( "isync": : :"memory")
66 #define __TBB_acquire_consistency_helper() __asm__ __volatile__("lwsync": : :"memory")
67 #define __TBB_release_consistency_helper() __asm__ __volatile__("lwsync": : :"memory")
68 #define __TBB_full_memory_fence() __asm__ __volatile__( "sync": : :"memory")
70 // IBM C++ Compiler does not support inline assembly
71 // TODO: Since XL 9.0 or earlier GCC syntax is supported. Replace with more
72 // lightweight implementation (like in mac_ppc.h)
73 #define __TBB_control_consistency_helper() __TBB_machine_isync ()
74 #define __TBB_acquire_consistency_helper() __TBB_machine_lwsync ()
75 #define __TBB_release_consistency_helper() __TBB_machine_lwsync ()
76 #define __TBB_full_memory_fence() __TBB_machine_flush ()