18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * arch/arm/probes/kprobes/checkers.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2014 Huawei Inc.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef _ARM_KERNEL_PROBES_CHECKERS_H
88c2ecf20Sopenharmony_ci#define _ARM_KERNEL_PROBES_CHECKERS_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/kernel.h>
118c2ecf20Sopenharmony_ci#include <linux/types.h>
128c2ecf20Sopenharmony_ci#include "../decode.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_none;
158c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_unknown;
168c2ecf20Sopenharmony_ci#ifdef CONFIG_THUMB2_KERNEL
178c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_imm_0xx;
188c2ecf20Sopenharmony_ci#else
198c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_imm_x0x;
208c2ecf20Sopenharmony_ci#endif
218c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_imm_xxx;
228c2ecf20Sopenharmony_ciextern probes_check_t checker_stack_use_stmdx;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cienum {
258c2ecf20Sopenharmony_ci	STACK_USE_NONE,
268c2ecf20Sopenharmony_ci	STACK_USE_UNKNOWN,
278c2ecf20Sopenharmony_ci#ifdef CONFIG_THUMB2_KERNEL
288c2ecf20Sopenharmony_ci	STACK_USE_FIXED_0XX,
298c2ecf20Sopenharmony_ci	STACK_USE_T32STRD,
308c2ecf20Sopenharmony_ci#else
318c2ecf20Sopenharmony_ci	STACK_USE_FIXED_X0X,
328c2ecf20Sopenharmony_ci#endif
338c2ecf20Sopenharmony_ci	STACK_USE_FIXED_XXX,
348c2ecf20Sopenharmony_ci	STACK_USE_STMDX,
358c2ecf20Sopenharmony_ci	NUM_STACK_USE_TYPES
368c2ecf20Sopenharmony_ci};
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciextern const union decode_action stack_check_actions[];
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#ifndef CONFIG_THUMB2_KERNEL
418c2ecf20Sopenharmony_ciextern const struct decode_checker arm_stack_checker[];
428c2ecf20Sopenharmony_ciextern const struct decode_checker arm_regs_checker[];
438c2ecf20Sopenharmony_ci#else
448c2ecf20Sopenharmony_ci#endif
458c2ecf20Sopenharmony_ciextern const struct decode_checker t32_stack_checker[];
468c2ecf20Sopenharmony_ciextern const struct decode_checker t16_stack_checker[];
478c2ecf20Sopenharmony_ci#endif
48