1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
6 #define PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
7 
8 #include "build/build_config.h"
9 
10 #if defined(ARCH_CPU_ARM64)
11 extern "C" {
12 /**
13  * A valid BTI function. Jumping to this funtion should not cause any problem in
14  * a BTI enabled environment.
15  **/
16 int64_t arm_bti_test_function(int64_t);
17 
18 /**
19  * A function without proper BTI landing pad. Jumping here should crash the
20  * program on systems which support BTI.
21  **/
22 int64_t arm_bti_test_function_invalid_offset(int64_t);
23 
24 /**
25  * A simple function which immediately returns to sender.
26  **/
27 void arm_bti_test_function_end(void);
28 }
29 #endif  // defined(ARCH_CPU_ARM64)
30 
31 #endif  // PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_
32