]> git.baikalelectronics.ru Git - kernel.git/commit
s390/disassembler: generate opcode tables from text file
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 6 Nov 2017 12:29:56 +0000 (13:29 +0100)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 8 Nov 2017 21:11:02 +0000 (22:11 +0100)
commit424dd731d8ff3cac79dfe90d9bcc47e166114df2
treec721bcd8ee142c47644c732353a3a98fab4a7989
parent221f5dc124e45507faccee239153bb2a6b7c75f4
s390/disassembler: generate opcode tables from text file

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>
arch/s390/Makefile
arch/s390/include/asm/dis.h
arch/s390/kernel/dis.c
arch/s390/tools/Makefile
arch/s390/tools/gen_opcode_table.c [new file with mode: 0644]
arch/s390/tools/opcodes.txt [new file with mode: 0644]