]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blame - arch/s390/include/asm/dis.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-kernels.git] / arch / s390 / include / asm / dis.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
648ae35c
SP
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/* Type of operand */
13#define OPERAND_GPR 0x1 /* Operand printed as %rx */
14#define OPERAND_FPR 0x2 /* Operand printed as %fx */
15#define OPERAND_AR 0x4 /* Operand printed as %ax */
16#define OPERAND_CR 0x8 /* Operand printed as %cx */
3585cb02
MS
17#define OPERAND_VR 0x10 /* Operand printed as %vx */
18#define OPERAND_DISP 0x20 /* Operand printed as displacement */
19#define OPERAND_BASE 0x40 /* Operand printed as base register */
20#define OPERAND_INDEX 0x80 /* Operand printed as index register */
21#define OPERAND_PCREL 0x100 /* Operand printed as pc-relative symbol */
22#define OPERAND_SIGNED 0x200 /* Operand printed as signed value */
23#define OPERAND_LENGTH 0x400 /* Operand printed as length (+1) */
648ae35c
SP
24
25
26struct s390_operand {
27 int bits; /* The number of bits in the operand. */
28 int shift; /* The number of bits to shift. */
29 int flags; /* One bit syntax flags. */
30};
31
32struct s390_insn {
33 const char name[5];
34 unsigned char opfrag;
35 unsigned char format;
36};
37
38
39static inline int insn_length(unsigned char code)
40{
41 return ((((int) code + 64) >> 7) + 1) << 1;
42}
43
db55947d
HC
44struct pt_regs;
45
0f20822a
HC
46void show_code(struct pt_regs *regs);
47void print_fn_code(unsigned char *code, unsigned long len);
48int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len);
1ffa11ab
HC
49struct s390_insn *find_insn(unsigned char *code);
50
51static inline int is_known_insn(unsigned char *code)
52{
53 return !!find_insn(code);
54}
0f20822a 55
648ae35c 56#endif /* __ASM_S390_DIS_H__ */