diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-03-30 14:09:41 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-03-30 14:09:41 +0200 |
commit | 5e0423804a6e421e0e8a22631eab42c984502f25 (patch) | |
tree | 8c4af9a6fd049ff6140fd7ca66160cb1ed273e5f /opcodes | |
parent | 346848622660e06b352613d425fe6ad67194ed14 (diff) | |
download | binutils-5e0423804a6e421e0e8a22631eab42c984502f25.zip binutils-5e0423804a6e421e0e8a22631eab42c984502f25.tar.gz binutils-5e0423804a6e421e0e8a22631eab42c984502f25.tar.bz2 |
x86: drop seg_entry
Use struct reg_entry instead for most purposes, with a separate array
holding just the respective opcode prefix bytes.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 7 | ||||
-rw-r--r-- | opcodes/i386-opc.c | 16 | ||||
-rw-r--r-- | opcodes/i386-opc.h | 15 |
3 files changed, 17 insertions, 21 deletions
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 <jbeulich@suse.com> + * 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 <jbeulich@suse.com> + * i386-opc.h (REGNAM_AL, REGNAM_AX, REGNAM_EAX): Delete. 2021-03-30 Jan Beulich <jbeulich@suse.com> 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]; |