linux/arch/x86/mm/pf_in.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Fault Injection Test harness (FI)
 *  Copyright (C) Intel Crop.
 */

/*  Id: pf_in.c,v 1.1.1.1 2002/11/12 05:56:32 brlock Exp
 *  Copyright by Intel Crop., 2002
 *  Louis Zhuang ([email protected])
 *
 *  Bjorn Steinbrink ([email protected]), 2007
 */

#include <linux/ptrace.h> /* struct pt_regs */
#include "pf_in.h"

#ifdef __i386__
/* IA32 Manual 3, 2-1 */
static unsigned char prefix_codes[] = {
	0xF0, 0xF2, 0xF3, 0x2E, 0x36, 0x3E, 0x26, 0x64,
	0x65, 0x66, 0x67
};
/* IA32 Manual 3, 3-432*/
static unsigned int reg_rop[] = {
	0x8A, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F
};
static unsigned int reg_wop[] = { 0x88, 0x89, 0xAA, 0xAB };
static unsigned int imm_wop[] = { 0xC6, 0xC7 };
/* IA32 Manual 3, 3-432*/
static unsigned int rw8[] = { 0x88, 0x8A, 0xC6, 0xAA };
static unsigned int rw32[] = {
	0x89, 0x8B, 0xC7, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F, 0xAB
};
static unsigned int mw8[] = { 0x88, 0x8A, 0xC6, 0xB60F, 0xBE0F, 0xAA };
static unsigned int mw16[] = { 0xB70F, 0xBF0F };
static unsigned int mw32[] = { 0x89, 0x8B, 0xC7, 0xAB };
static unsigned int mw64[] = {};
#else /* not __i386__ */
static unsigned char prefix_codes[] =;
/* AMD64 Manual 3, Appendix A*/
static unsigned int reg_rop[] =;
static unsigned int reg_wop[] =;
static unsigned int imm_wop[] =;
static unsigned int rw8[] =;
static unsigned int rw32[] =;
/* 8 bit only */
static unsigned int mw8[] =;
/* 16 bit only */
static unsigned int mw16[] =;
/* 16 or 32 bit */
static unsigned int mw32[] =;
/* 16, 32 or 64 bit */
static unsigned int mw64[] =;
#endif /* not __i386__ */

struct prefix_bits {};

static int skip_prefix(unsigned char *addr, struct prefix_bits *prf)
{}

static int get_opcode(unsigned char *addr, unsigned int *opcode)
{}

#define CHECK_OP_TYPE

enum reason_type get_ins_type(unsigned long ins_addr)
{}
#undef CHECK_OP_TYPE

static unsigned int get_ins_reg_width(unsigned long ins_addr)
{}

unsigned int get_ins_mem_width(unsigned long ins_addr)
{}

/*
 * Define register ident in mod/rm byte.
 * Note: these are NOT the same as in ptrace-abi.h.
 */
enum {};

static unsigned char *get_reg_w8(int no, int rex, struct pt_regs *regs)
{}

static unsigned long *get_reg_w32(int no, struct pt_regs *regs)
{}

unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs)
{}

unsigned long get_ins_imm_val(unsigned long ins_addr)
{}