162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Fault Injection Test harness (FI) 462306a36Sopenharmony_ci * Copyright (C) Intel Crop. 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#ifndef __PF_H_ 862306a36Sopenharmony_ci#define __PF_H_ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_cienum reason_type { 1162306a36Sopenharmony_ci NOT_ME, /* page fault is not in regions */ 1262306a36Sopenharmony_ci NOTHING, /* access others point in regions */ 1362306a36Sopenharmony_ci REG_READ, /* read from addr to reg */ 1462306a36Sopenharmony_ci REG_WRITE, /* write from reg to addr */ 1562306a36Sopenharmony_ci IMM_WRITE, /* write from imm to addr */ 1662306a36Sopenharmony_ci OTHERS /* Other instructions can not intercept */ 1762306a36Sopenharmony_ci}; 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_cienum reason_type get_ins_type(unsigned long ins_addr); 2062306a36Sopenharmony_ciunsigned int get_ins_mem_width(unsigned long ins_addr); 2162306a36Sopenharmony_ciunsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs); 2262306a36Sopenharmony_ciunsigned long get_ins_imm_val(unsigned long ins_addr); 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci#endif /* __PF_H_ */ 25