1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NATIVE_BRIDGE_SUPPORT_LINKER_STATIC_TLS_CONFIG_H_
18 #define NATIVE_BRIDGE_SUPPORT_LINKER_STATIC_TLS_CONFIG_H_
19 
20 #include <stdlib.h>
21 
22 struct NativeBridgeStaticTlsConfig {
23   // The size will be a multiple of the static TLS memory's alignment, which is
24   // at most one page.
25   size_t size;
26 
27   // The offset from the start of static TLS to the thread pointer.
28   size_t tpoff;
29 
30   // Image to initialize the static TLS with. This image covers the entire area.
31   const void* init_img;
32 
33   // The guest's value for TLS_SLOT_THREAD_ID.
34   int tls_slot_thread_id;
35 
36   // The guest's value for TLS_SLOT_BIONIC_TLS.
37   int tls_slot_bionic_tls;
38 };
39 
40 #endif  // NATIVE_BRIDGE_SUPPORT_LINKER_STATIC_TLS_CONFIG_H_
41