From 5e0423804a6e421e0e8a22631eab42c984502f25 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 30 Mar 2021 14:09:41 +0200 Subject: x86: drop seg_entry Use struct reg_entry instead for most purposes, with a separate array holding just the respective opcode prefix bytes. --- opcodes/ChangeLog | 7 +++++++ opcodes/i386-opc.c | 16 +++++++++------- opcodes/i386-opc.h | 15 +-------------- 3 files changed, 17 insertions(+), 21 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index fb5b8c7..7179187 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,12 @@ 2021-03-30 Jan Beulich + * i386-opc.c (cs, ds, ss, es, fs, gs): Delete. + (i386_seg_prefixes): New. + * i386-opc.h (cs, ds, ss, es, fs, gs): Delete. + (i386_seg_prefixes): Declare. + +2021-03-30 Jan Beulich + * i386-opc.h (REGNAM_AL, REGNAM_AX, REGNAM_EAX): Delete. 2021-03-30 Jan Beulich diff --git a/opcodes/i386-opc.c b/opcodes/i386-opc.c index 370adc3..ca3bdfb 100644 --- a/opcodes/i386-opc.c +++ b/opcodes/i386-opc.c @@ -23,10 +23,12 @@ #include "i386-opc.h" #include "i386-tbl.h" -/* Segment stuff. */ -const seg_entry cs = { "cs", 0x2e }; -const seg_entry ds = { "ds", 0x3e }; -const seg_entry ss = { "ss", 0x36 }; -const seg_entry es = { "es", 0x26 }; -const seg_entry fs = { "fs", 0x64 }; -const seg_entry gs = { "gs", 0x65 }; +/* To be indexed by segment register number. */ +const unsigned char i386_seg_prefixes[] = { + ES_PREFIX_OPCODE, + CS_PREFIX_OPCODE, + SS_PREFIX_OPCODE, + DS_PREFIX_OPCODE, + FS_PREFIX_OPCODE, + GS_PREFIX_OPCODE +}; diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h index 9c451de..60c445f 100644 --- a/opcodes/i386-opc.h +++ b/opcodes/i386-opc.h @@ -992,17 +992,4 @@ reg_entry; extern const reg_entry i386_regtab[]; extern const unsigned int i386_regtab_size; - -typedef struct -{ - char *seg_name; - unsigned int seg_prefix; -} -seg_entry; - -extern const seg_entry cs; -extern const seg_entry ds; -extern const seg_entry ss; -extern const seg_entry es; -extern const seg_entry fs; -extern const seg_entry gs; +extern const unsigned char i386_seg_prefixes[6]; -- cgit v1.1