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