summaryrefslogtreecommitdiff
path: root/opcodes/microblaze-dis.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-27 01:55:50 -0400
committerMike Frysinger <vapier@gentoo.org>2021-07-01 17:55:26 -0400
commit52b8387412e32380013a46dd00959e65ecef71fb (patch)
tree58c187ee90d65e0ab2b3e055dec6f02cca0ae114 /opcodes/microblaze-dis.c
parent6c2ede018c51895a3ce7902c86698b90a086e6e0 (diff)
downloadbinutils-gdb-52b8387412e32380013a46dd00959e65ecef71fb.tar.gz
opcodes: constify & scope microblaze opcodes
This is exporting the variable "opcodes" as a large writable blob. This is not a namespace friendly name, so add a "microblaze" prefix, and then sprinkle const over its definition & use.
Diffstat (limited to 'opcodes/microblaze-dis.c')
-rw-r--r--opcodes/microblaze-dis.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/opcodes/microblaze-dis.c b/opcodes/microblaze-dis.c
index aa75c4cc1fd..1696f559a0b 100644
--- a/opcodes/microblaze-dis.c
+++ b/opcodes/microblaze-dis.c
@@ -111,7 +111,7 @@ get_field_imm15 (struct string_buf *buf, long instr)
static char *
get_field_special (struct string_buf *buf, long instr,
- struct op_code_struct *op)
+ const struct op_code_struct *op)
{
char *p = strbuf (buf);
char *spr;
@@ -184,11 +184,11 @@ get_field_special (struct string_buf *buf, long instr,
static unsigned long
read_insn_microblaze (bfd_vma memaddr,
struct disassemble_info *info,
- struct op_code_struct **opr)
+ const struct op_code_struct **opr)
{
unsigned char ibytes[4];
int status;
- struct op_code_struct * op;
+ const struct op_code_struct *op;
unsigned long inst;
status = info->read_memory_func (memaddr, ibytes, 4, info);
@@ -209,7 +209,7 @@ read_insn_microblaze (bfd_vma memaddr,
abort ();
/* Just a linear search of the table. */
- for (op = opcodes; op->name != 0; op ++)
+ for (op = microblaze_opcodes; op->name != 0; op ++)
if (op->bit_sequence == (inst & op->opcode_mask))
break;
@@ -224,7 +224,7 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
fprintf_ftype print_func = info->fprintf_func;
void *stream = info->stream;
unsigned long inst, prev_inst;
- struct op_code_struct *op, *pop;
+ const struct op_code_struct *op, *pop;
int immval = 0;
bool immfound = false;
static bfd_vma prev_insn_addr = -1; /* Init the prev insn addr. */
@@ -452,11 +452,11 @@ get_insn_microblaze (long inst,
enum microblaze_instr_type *insn_type,
short *delay_slots)
{
- struct op_code_struct * op;
+ const struct op_code_struct *op;
*isunsignedimm = false;
/* Just a linear search of the table. */
- for (op = opcodes; op->name != 0; op ++)
+ for (op = microblaze_opcodes; op->name != 0; op ++)
if (op->bit_sequence == (inst & op->opcode_mask))
break;
@@ -494,12 +494,12 @@ microblaze_get_target_address (long inst, bool immfound, int immval,
bool *targetvalid,
bool *unconditionalbranch)
{
- struct op_code_struct * op;
+ const struct op_code_struct *op;
long targetaddr = 0;
*unconditionalbranch = false;
/* Just a linear search of the table. */
- for (op = opcodes; op->name != 0; op ++)
+ for (op = microblaze_opcodes; op->name != 0; op ++)
if (op->bit_sequence == (inst & op->opcode_mask))
break;