arm_bti_test_functions.h 941 B

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