void
md_begin (void)
{
- struct op_code_struct * opcode;
+ const struct op_code_struct * opcode;
opcode_hash_control = str_htab_create ();
/* Insert unique names into hash table. */
- for (opcode = opcodes; opcode->name; opcode ++)
+ for (opcode = microblaze_opcodes; opcode->name; opcode ++)
str_hash_insert (opcode_hash_control, opcode->name, opcode, 0);
}
+2021-07-01 Mike Frysinger <vapier@gentoo.org>
+
+ * microblaze-dis.c (get_field_special): Make op const.
+ (read_insn_microblaze): Make opr & op const. Rename opcodes to
+ microblaze_opcodes.
+ (print_insn_microblaze): Make op & pop const.
+ (get_insn_microblaze): Make op const. Rename opcodes to
+ microblaze_opcodes.
+ (microblaze_get_target_address): Likewise.
+ * microblaze-opc.h (struct op_code_struct): Make const.
+ Rename opcodes to microblaze_opcodes.
+
2021-07-01 Mike Frysinger <vapier@gentoo.org>
* aarch64-gen.c (aarch64_opcode_table): Add const.
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;
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);
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;
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. */
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;
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;
#define MAX_OPCODES 289
-struct op_code_struct
+const struct op_code_struct
{
const char * name;
short inst_type; /* Registers and immediate values involved. */
enum microblaze_instr instr;
enum microblaze_instr_type instr_type;
/* More info about output format here. */
-} opcodes[MAX_OPCODES] =
+} microblaze_opcodes[MAX_OPCODES] =
{
{"add", INST_TYPE_RD_R1_R2, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x00000000, OPCODE_MASK_H4, add, arithmetic_inst },
{"rsub", INST_TYPE_RD_R1_R2, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x04000000, OPCODE_MASK_H4, rsub, arithmetic_inst },