2 Copyright (c) 2014 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_host.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 SharedTableEntry __offload_myo_shared_table_end
= { (const char*)-1, 0 };
74 static SharedTableEntry __offload_myo_shared_table_end
= { 0 };
75 #endif // TARGET_WINNT
78 // offload myo shared var init section epilog
79 ALLOCATE(OFFLOAD_MYO_SHARED_INIT_TABLE_SECTION_END
)
81 __declspec(align(sizeof(InitTableEntry
)))
82 static InitTableEntry __offload_myo_shared_init_table_end
= { (const char*)-1, 0 };
84 static InitTableEntry __offload_myo_shared_init_table_end
= { 0 };
85 #endif // TARGET_WINNT
86 #endif // HOST_LIBRARY
88 // offload myo fptr section epilog
89 ALLOCATE(OFFLOAD_MYO_FPTR_TABLE_SECTION_END
)
91 __declspec(align(sizeof(FptrTableEntry
)))
92 static FptrTableEntry __offload_myo_fptr_table_end
= { (const char*)-1, 0, 0 };
94 static FptrTableEntry __offload_myo_fptr_table_end
= { 0 };
95 #endif // TARGET_WINNT