blob: 48e42ae2c80a3ea43d647bdd14e4c4e46eb0758b [file] [log] [blame]
Siva Chandra Reddy5d593852020-06-24 14:12:46 -07001//===-- 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
14namespace __llvm_libc {
15
16// Data structure to capture properties of the linux/ELF TLS.
17struct 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.
30struct 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.
40void initTLS();
41
42} // namespace __llvm_libc
43
44#endif // LLVM_LIBC_CONFIG_LINUX_APP_H