~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/include/asm/insn-eval.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ASM_X86_INSN_EVAL_H
  2 #define _ASM_X86_INSN_EVAL_H
  3 /*
  4  * A collection of utility functions for x86 instruction analysis to be
  5  * used in a kernel context. Useful when, for instance, making sense
  6  * of the registers indicated by operands.
  7  */
  8 
  9 #include <linux/compiler.h>
 10 #include <linux/bug.h>
 11 #include <linux/err.h>
 12 #include <asm/ptrace.h>
 13 
 14 #define INSN_CODE_SEG_ADDR_SZ(params) ((params >> 4) & 0xf)
 15 #define INSN_CODE_SEG_OPND_SZ(params) (params & 0xf)
 16 #define INSN_CODE_SEG_PARAMS(oper_sz, addr_sz) (oper_sz | (addr_sz << 4))
 17 
 18 int pt_regs_offset(struct pt_regs *regs, int regno);
 19 
 20 bool insn_has_rep_prefix(struct insn *insn);
 21 void __user *insn_get_addr_ref(struct insn *insn, struct pt_regs *regs);
 22 int insn_get_modrm_rm_off(struct insn *insn, struct pt_regs *regs);
 23 int insn_get_modrm_reg_off(struct insn *insn, struct pt_regs *regs);
 24 unsigned long *insn_get_modrm_reg_ptr(struct insn *insn, struct pt_regs *regs);
 25 unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx);
 26 int insn_get_code_seg_params(struct pt_regs *regs);
 27 int insn_get_effective_ip(struct pt_regs *regs, unsigned long *ip);
 28 int insn_fetch_from_user(struct pt_regs *regs,
 29                          unsigned char buf[MAX_INSN_SIZE]);
 30 int insn_fetch_from_user_inatomic(struct pt_regs *regs,
 31                                   unsigned char buf[MAX_INSN_SIZE]);
 32 bool insn_decode_from_regs(struct insn *insn, struct pt_regs *regs,
 33                            unsigned char buf[MAX_INSN_SIZE], int buf_size);
 34 
 35 enum insn_mmio_type {
 36         INSN_MMIO_DECODE_FAILED,
 37         INSN_MMIO_WRITE,
 38         INSN_MMIO_WRITE_IMM,
 39         INSN_MMIO_READ,
 40         INSN_MMIO_READ_ZERO_EXTEND,
 41         INSN_MMIO_READ_SIGN_EXTEND,
 42         INSN_MMIO_MOVS,
 43 };
 44 
 45 enum insn_mmio_type insn_decode_mmio(struct insn *insn, int *bytes);
 46 
 47 #endif /* _ASM_X86_INSN_EVAL_H */
 48 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php