Path: blob/main/base/allocator/partition_allocator/src/partition_alloc/arm_bti_test_functions.h
41933 views
// Copyright 2021 The Chromium Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34#ifdef UNSAFE_BUFFERS_BUILD5// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.6#pragma allow_unsafe_buffers7#endif89#ifndef PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_10#define PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_1112#include "partition_alloc/build_config.h"1314#if PA_BUILDFLAG(PA_ARCH_CPU_ARM64)15extern "C" {16/**17* A valid BTI function. Jumping to this funtion should not cause any problem in18* a BTI enabled environment.19**/20int64_t arm_bti_test_function(int64_t);2122/**23* A function without proper BTI landing pad. Jumping here should crash the24* program on systems which support BTI.25**/26int64_t arm_bti_test_function_invalid_offset(int64_t);2728/**29* A simple function which immediately returns to sender.30**/31void arm_bti_test_function_end(void);32}33#endif // PA_BUILDFLAG(PA_ARCH_CPU_ARM64)3435#endif // PARTITION_ALLOC_ARM_BTI_TEST_FUNCTIONS_H_363738