mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
8bc1e4ec79
The current way of adding new instructions to the opcode tables is painful and error prone. Therefore add, similar to binutils, a text file which contains all opcodes and the corresponding mnemonics and instruction formats. A small gen_opcode_table tool then generates a header file with the required enums and opcode table initializers at the prepare step of the kernel build. This way only a simple text file has to be maintained, which can be rather easily extended. Unlike before where there were plenty of opcode tables and a large switch statement to find the correct opcode table, there is now only one opcode table left which contains all instructions. A second opcode offset table now contains offsets within the opcode table to find instructions which have the same opcode prefix. In order to save space all 1-byte opcode instructions are grouped together at the end of the opcode table. This is also quite similar to like it was before. In addition also move and change code and definitions within the disassembler. As a side effect this reduces the size required for the code and opcode tables by ~1.5k. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
30 lines
598 B
C
30 lines
598 B
C
/*
|
|
* Disassemble s390 instructions.
|
|
*
|
|
* Copyright IBM Corp. 2007
|
|
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
|
|
*/
|
|
|
|
#ifndef __ASM_S390_DIS_H__
|
|
#define __ASM_S390_DIS_H__
|
|
|
|
#include <generated/dis.h>
|
|
|
|
static inline int insn_length(unsigned char code)
|
|
{
|
|
return ((((int) code + 64) >> 7) + 1) << 1;
|
|
}
|
|
|
|
struct pt_regs;
|
|
|
|
void show_code(struct pt_regs *regs);
|
|
void print_fn_code(unsigned char *code, unsigned long len);
|
|
struct s390_insn *find_insn(unsigned char *code);
|
|
|
|
static inline int is_known_insn(unsigned char *code)
|
|
{
|
|
return !!find_insn(code);
|
|
}
|
|
|
|
#endif /* __ASM_S390_DIS_H__ */
|