2 Copyright (c) 2014-2016 Intel Corporation. All Rights Reserved.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
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.
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.
32 #include "offload_table.h"
34 #include "offload_myo_host.h"
37 #include "offload_target.h"
39 #include "offload_myo_target.h"
41 #endif // HOST_LIBRARY
44 #define ALLOCATE(name) __declspec(allocate(name))
46 #define ALLOCATE(name) __attribute__((section(name)))
47 #endif // TARGET_WINNT
49 // offload entry table
50 ALLOCATE(OFFLOAD_ENTRY_TABLE_SECTION_END
)
52 __declspec(align(sizeof(FuncTable::Entry
)))
53 #endif // TARGET_WINNT
54 static FuncTable::Entry __offload_entry_table_end
= { (const char*)-1 };
56 // offload function table
57 ALLOCATE(OFFLOAD_FUNC_TABLE_SECTION_END
)
59 __declspec(align(sizeof(FuncTable::Entry
)))
60 #endif // TARGET_WINNT
61 static FuncTable::Entry __offload_func_table_end
= { (const char*)-1 };
64 ALLOCATE(OFFLOAD_VAR_TABLE_SECTION_END
)
66 __declspec(align(sizeof(VarTable::Entry
)))
67 #endif // TARGET_WINNT
68 static VarTable::Entry __offload_var_table_end
= { (const char*)-1 };
72 // offload myo shared var section epilog
73 ALLOCATE(OFFLOAD_MYO_SHARED_TABLE_SECTION_END
)
75 __declspec(align(sizeof(SharedTableEntry
)))
76 static MYOVarTable::Entry __offload_myo_shared_var_end
=
77 { (const char*)-1, 0 };
79 static MYOVarTable::Entry __offload_myo_shared_var_end
= { 0 };
80 #endif // TARGET_WINNT
82 // offload myo shared vtable section epilog
83 ALLOCATE(OFFLOAD_MYO_SHARED_VTABLE_SECTION_END
)
85 __declspec(align(sizeof(SharedTableEntry
)))
86 static MYOVarTable::Entry __offload_myo_shared_vtable_end
=
87 { (const char*)-1, 0 };
89 static MYOVarTable::Entry __offload_myo_shared_vtable_end
= { 0 };
90 #endif // TARGET_WINNT
93 // offload myo shared var init section epilog
94 ALLOCATE(OFFLOAD_MYO_SHARED_INIT_TABLE_SECTION_END
)
96 __declspec(align(sizeof(InitTableEntry
)))
97 static MYOInitTable::Entry __offload_myo_init_table_end
=
98 { (const char*)-1, 0 };
100 static MYOInitTable::Entry __offload_myo_init_table_end
= { 0 };
101 #endif // TARGET_WINNT
102 //#endif // HOST_LIBRARY
104 // offload myo fptr section epilog
105 ALLOCATE(OFFLOAD_MYO_FPTR_TABLE_SECTION_END
)
107 __declspec(align(sizeof(FptrTableEntry
)))
108 static MYOFuncTable::Entry __offload_myo_fptr_table_end
=
109 { (const char*)-1, 0, 0 };
110 #else // TARGET_WINNT
111 static MYOFuncTable::Entry __offload_myo_fptr_table_end
= { 0 };
112 #endif // TARGET_WINNT
114 #endif // MYO_SUPPORT