BRE12
external
tbb
include
tbb
machine
ibm_aix51.h
1
/*
2
Copyright 2005-2016 Intel Corporation. All Rights Reserved.
3
4
This file is part of Threading Building Blocks. Threading Building Blocks is free software;
5
you can redistribute it and/or modify it under the terms of the GNU General Public License
6
version 2 as published by the Free Software Foundation. Threading Building Blocks is
7
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
8
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
See the GNU General Public License for more details. You should have received a copy of
10
the GNU General Public License along with Threading Building Blocks; if not, write to the
11
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
12
13
As a special exception, you may use this file as part of a free software library without
14
restriction. Specifically, if other files instantiate templates or use macros or inline
15
functions from this file, or you compile this file and link it with other files to produce
16
an executable, this file does not by itself cause the resulting executable to be covered
17
by the GNU General Public License. This exception does not however invalidate any other
18
reasons why the executable file might be covered by the GNU General Public License.
19
*/
20
21
// TODO: revise by comparing with mac_ppc.h
22
23
#if !defined(__TBB_machine_H) || defined(__TBB_machine_ibm_aix51_H)
24
#error Do not #include this internal file directly; use public TBB headers instead.
25
#endif
26
27
#define __TBB_machine_ibm_aix51_H
28
29
#define __TBB_WORDSIZE 8
30
#define __TBB_ENDIANNESS __TBB_ENDIAN_BIG // assumption based on operating system
31
32
#include <stdint.h>
33
#include <unistd.h>
34
#include <sched.h>
35
36
extern
"C"
{
37
int32_t __TBB_machine_cas_32 (
volatile
void
* ptr, int32_t value, int32_t comparand);
38
int64_t __TBB_machine_cas_64 (
volatile
void
* ptr, int64_t value, int64_t comparand);
39
void
__TBB_machine_flush ();
40
void
__TBB_machine_lwsync ();
41
void
__TBB_machine_isync ();
42
}
43
44
// Mapping of old entry point names retained for the sake of backward binary compatibility
45
#define __TBB_machine_cmpswp4 __TBB_machine_cas_32
46
#define __TBB_machine_cmpswp8 __TBB_machine_cas_64
47
48
#define __TBB_Yield() sched_yield()
49
50
#define __TBB_USE_GENERIC_PART_WORD_CAS 1
51
#define __TBB_USE_GENERIC_FETCH_ADD 1
52
#define __TBB_USE_GENERIC_FETCH_STORE 1
53
#define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
54
#define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
55
#define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1
56
57
#if __GNUC__
58
#define __TBB_control_consistency_helper() __asm__ __volatile__( "isync": : :"memory")
59
#define __TBB_acquire_consistency_helper() __asm__ __volatile__("lwsync": : :"memory")
60
#define __TBB_release_consistency_helper() __asm__ __volatile__("lwsync": : :"memory")
61
#define __TBB_full_memory_fence() __asm__ __volatile__( "sync": : :"memory")
62
#else
63
// IBM C++ Compiler does not support inline assembly
64
// TODO: Since XL 9.0 or earlier GCC syntax is supported. Replace with more
65
// lightweight implementation (like in mac_ppc.h)
66
#define __TBB_control_consistency_helper() __TBB_machine_isync ()
67
#define __TBB_acquire_consistency_helper() __TBB_machine_lwsync ()
68
#define __TBB_release_consistency_helper() __TBB_machine_lwsync ()
69
#define __TBB_full_memory_fence() __TBB_machine_flush ()
70
#endif
Generated by
1.8.12