dis.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Disassemble s390 instructions.
  3. *
  4. * Copyright IBM Corp. 2007
  5. * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
  6. */
  7. #ifndef __ASM_S390_DIS_H__
  8. #define __ASM_S390_DIS_H__
  9. /* Type of operand */
  10. #define OPERAND_GPR 0x1 /* Operand printed as %rx */
  11. #define OPERAND_FPR 0x2 /* Operand printed as %fx */
  12. #define OPERAND_AR 0x4 /* Operand printed as %ax */
  13. #define OPERAND_CR 0x8 /* Operand printed as %cx */
  14. #define OPERAND_DISP 0x10 /* Operand printed as displacement */
  15. #define OPERAND_BASE 0x20 /* Operand printed as base register */
  16. #define OPERAND_INDEX 0x40 /* Operand printed as index register */
  17. #define OPERAND_PCREL 0x80 /* Operand printed as pc-relative symbol */
  18. #define OPERAND_SIGNED 0x100 /* Operand printed as signed value */
  19. #define OPERAND_LENGTH 0x200 /* Operand printed as length (+1) */
  20. struct s390_operand {
  21. int bits; /* The number of bits in the operand. */
  22. int shift; /* The number of bits to shift. */
  23. int flags; /* One bit syntax flags. */
  24. };
  25. struct s390_insn {
  26. const char name[5];
  27. unsigned char opfrag;
  28. unsigned char format;
  29. };
  30. static inline int insn_length(unsigned char code)
  31. {
  32. return ((((int) code + 64) >> 7) + 1) << 1;
  33. }
  34. void show_code(struct pt_regs *regs);
  35. void print_fn_code(unsigned char *code, unsigned long len);
  36. int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len);
  37. #endif /* __ASM_S390_DIS_H__ */