1//===-- sanitizer/safestack_interface.h -------------------------*- 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// This file is a part of SafeStack.
10//
11// Public interface header.
12//===----------------------------------------------------------------------===//
13#ifndef SANITIZER_SAFESTACK_INTERFACE_H
14#define SANITIZER_SAFESTACK_INTERFACE_H
15
16#include <sanitizer/common_interface_defs.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/// Returns the current unsafe stack pointer of the current thread.
23const void *SANITIZER_CDECL __safestack_get_unsafe_stack_ptr(void);
24
25/// Returns a pointer to the bottom of the unsafe stack of the current thread.
26const void *SANITIZER_CDECL __safestack_get_unsafe_stack_bottom(void);
27
28/// Returns a pointer to the top of the unsafe stack of the current thread.
29const void *SANITIZER_CDECL __safestack_get_unsafe_stack_top(void);
30
31/// Returns a pointer to the top of the unsafe sigalt stack of the current
32/// thread.
33const void *SANITIZER_CDECL __safestack_get_unsafe_sigalt_stack_ptr(void);
34
35/// Returns a pointer to the bottom of the unsafe sigalt stack of the current
36/// thread.
37const void *SANITIZER_CDECL __safestack_get_unsafe_sigalt_stack_bottom(void);
38
39/// Returns a pointer to the top of the unsafe sigalt stack of the current
40/// thread.
41const void *SANITIZER_CDECL __safestack_get_unsafe_sigalt_stack_top(void);
42
43/// Set a new unsafe signal stack context to be used if SA_ONSTACK is set.
44int SANITIZER_CDECL __safestack_unsafe_sigaltstack(size_t ss_size);
45
46#ifdef __cplusplus
47} // extern "C"
48#endif
49
50#endif // SANITIZER_SAFESTACK_INTERFACE_H
51