]> git.ipfire.org Git - thirdparty/gcc.git/blame - liboffloadmic/runtime/offload_myo_target.h
libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library.
[thirdparty/gcc.git] / liboffloadmic / runtime / offload_myo_target.h
CommitLineData
5f520819
KY
1/*
2 Copyright (c) 2014 Intel Corporation. All Rights Reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
6 are met:
7
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its
14 contributors may be used to endorse or promote products derived
15 from this software without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30
31#ifndef OFFLOAD_MYO_TARGET_H_INCLUDED
32#define OFFLOAD_MYO_TARGET_H_INCLUDED
33
34#include <myotypes.h>
35#include <myoimpl.h>
36#include <myo.h>
37#include "offload.h"
38
39typedef MyoiSharedVarEntry SharedTableEntry;
40typedef MyoiTargetSharedFptrEntry FptrTableEntry;
41
42#ifdef TARGET_WINNT
43#define OFFLOAD_MYO_SHARED_TABLE_SECTION_START ".MyoSharedTable$a"
44#define OFFLOAD_MYO_SHARED_TABLE_SECTION_END ".MyoSharedTable$z"
45
46#define OFFLOAD_MYO_FPTR_TABLE_SECTION_START ".MyoFptrTable$a"
47#define OFFLOAD_MYO_FPTR_TABLE_SECTION_END ".MyoFptrTable$z"
48#else // TARGET_WINNT
49#define OFFLOAD_MYO_SHARED_TABLE_SECTION_START ".MyoSharedTable."
50#define OFFLOAD_MYO_SHARED_TABLE_SECTION_END ".MyoSharedTable."
51
52#define OFFLOAD_MYO_FPTR_TABLE_SECTION_START ".MyoFptrTable."
53#define OFFLOAD_MYO_FPTR_TABLE_SECTION_END ".MyoFptrTable."
54#endif // TARGET_WINNT
55
56#pragma section(OFFLOAD_MYO_SHARED_TABLE_SECTION_START, read, write)
57#pragma section(OFFLOAD_MYO_SHARED_TABLE_SECTION_END, read, write)
58
59#pragma section(OFFLOAD_MYO_FPTR_TABLE_SECTION_START, read, write)
60#pragma section(OFFLOAD_MYO_FPTR_TABLE_SECTION_END, read, write)
61
62extern "C" void __offload_myoRegisterTables(
63 SharedTableEntry *shared_table,
64 FptrTableEntry *fptr_table
65);
66
67extern "C" void __offload_myoAcquire(void);
68extern "C" void __offload_myoRelease(void);
69
70// temporary workaround for blocking behavior for myoiLibInit/Fini calls
71extern "C" void __offload_myoLibInit();
72extern "C" void __offload_myoLibFini();
73
74#endif // OFFLOAD_MYO_TARGET_H_INCLUDED