18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Fault Injection Test harness (FI) 48c2ecf20Sopenharmony_ci * Copyright (C) Intel Crop. 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef __PF_H_ 88c2ecf20Sopenharmony_ci#define __PF_H_ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_cienum reason_type { 118c2ecf20Sopenharmony_ci NOT_ME, /* page fault is not in regions */ 128c2ecf20Sopenharmony_ci NOTHING, /* access others point in regions */ 138c2ecf20Sopenharmony_ci REG_READ, /* read from addr to reg */ 148c2ecf20Sopenharmony_ci REG_WRITE, /* write from reg to addr */ 158c2ecf20Sopenharmony_ci IMM_WRITE, /* write from imm to addr */ 168c2ecf20Sopenharmony_ci OTHERS /* Other instructions can not intercept */ 178c2ecf20Sopenharmony_ci}; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_cienum reason_type get_ins_type(unsigned long ins_addr); 208c2ecf20Sopenharmony_ciunsigned int get_ins_mem_width(unsigned long ins_addr); 218c2ecf20Sopenharmony_ciunsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs); 228c2ecf20Sopenharmony_ciunsigned long get_ins_imm_val(unsigned long ins_addr); 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#endif /* __PF_H_ */ 25