Siva Chandra Reddy | 5d59385 | 2020-06-24 14:12:46 -0700 | [diff] [blame] | 1 | //===-- Classes to capture properites of linux applications -----*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef LLVM_LIBC_CONFIG_LINUX_APP_H |
| 10 | #define LLVM_LIBC_CONFIG_LINUX_APP_H |
| 11 | |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | namespace __llvm_libc { |
| 15 | |
| 16 | // Data structure to capture properties of the linux/ELF TLS. |
| 17 | struct TLS { |
| 18 | // The load address of the TLS. |
| 19 | uintptr_t address; |
| 20 | |
| 21 | // The bytes size of the TLS. |
| 22 | uintptr_t size; |
| 23 | |
| 24 | // The alignment of the TLS layout. It assumed that the alignment |
| 25 | // value is a power of 2. |
| 26 | uintptr_t align; |
| 27 | }; |
| 28 | |
| 29 | // Data structure which captures properties of a linux application. |
| 30 | struct AppProperties { |
| 31 | // Page size used for the application. |
| 32 | uintptr_t pageSize; |
| 33 | |
| 34 | // The properties of an application's TLS. |
| 35 | TLS tls; |
| 36 | }; |
| 37 | |
| 38 | // Creates and initializes the TLS area for the current thread. Should not |
| 39 | // be called before app.tls has been initialized. |
| 40 | void initTLS(); |
| 41 | |
| 42 | } // namespace __llvm_libc |
| 43 | |
| 44 | #endif // LLVM_LIBC_CONFIG_LINUX_APP_H |