2 Copyright (c) 2014-2015 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"
33 #include "offload_myo_host.h"
35 #include "offload_target.h"
36 #include "offload_myo_target.h"
40 #define ALLOCATE(name) __declspec(allocate(name))
42 #define ALLOCATE(name) __attribute__((section(name)))
43 #endif // TARGET_WINNT
45 // offload entry table
46 ALLOCATE(OFFLOAD_ENTRY_TABLE_SECTION_END
)
48 __declspec(align(sizeof(FuncTable::Entry
)))
49 #endif // TARGET_WINNT
50 static FuncTable::Entry __offload_entry_table_end
= { (const char*)-1 };
52 // offload function table
53 ALLOCATE(OFFLOAD_FUNC_TABLE_SECTION_END
)
55 __declspec(align(sizeof(FuncTable::Entry
)))
56 #endif // TARGET_WINNT
57 static FuncTable::Entry __offload_func_table_end
= { (const char*)-1 };
60 ALLOCATE(OFFLOAD_VAR_TABLE_SECTION_END
)
62 __declspec(align(sizeof(VarTable::Entry
)))
63 #endif // TARGET_WINNT
64 static VarTable::Entry __offload_var_table_end
= { (const char*)-1 };
68 // offload myo shared var section epilog
69 ALLOCATE(OFFLOAD_MYO_SHARED_TABLE_SECTION_END
)
71 __declspec(align(sizeof(SharedTableEntry
)))
72 static MYOVarTable::Entry __offload_myo_shared_var_end
=
73 { (const char*)-1, 0 };
75 static MYOVarTable::Entry __offload_myo_shared_var_end
= { 0 };
76 #endif // TARGET_WINNT
78 // offload myo shared vtable section epilog
79 ALLOCATE(OFFLOAD_MYO_SHARED_VTABLE_SECTION_END
)
81 __declspec(align(sizeof(SharedTableEntry
)))
82 static MYOVarTable::Entry __offload_myo_shared_vtable_end
=
83 { (const char*)-1, 0 };
85 static MYOVarTable::Entry __offload_myo_shared_vtable_end
= { 0 };
86 #endif // TARGET_WINNT
89 // offload myo shared var init section epilog
90 ALLOCATE(OFFLOAD_MYO_SHARED_INIT_TABLE_SECTION_END
)
92 __declspec(align(sizeof(InitTableEntry
)))
93 static MYOInitTable::Entry __offload_myo_init_table_end
=
94 { (const char*)-1, 0 };
96 static MYOInitTable::Entry __offload_myo_init_table_end
= { 0 };
97 #endif // TARGET_WINNT
98 //#endif // HOST_LIBRARY
100 // offload myo fptr section epilog
101 ALLOCATE(OFFLOAD_MYO_FPTR_TABLE_SECTION_END
)
103 __declspec(align(sizeof(FptrTableEntry
)))
104 static MYOFuncTable::Entry __offload_myo_fptr_table_end
=
105 { (const char*)-1, 0, 0 };
106 #else // TARGET_WINNT
107 static MYOFuncTable::Entry __offload_myo_fptr_table_end
= { 0 };
108 #endif // TARGET_WINNT
110 #endif // MYO_SUPPORT