diff options
author | Alan Modra <amodra@gmail.com> | 2020-12-15 22:09:06 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-12-16 15:17:53 +1030 |
commit | 61d2295d723c7d202f530ccca1eacb4cfedf06d9 (patch) | |
tree | 3ca0532f0e9caf045220658c07a5a118b9874893 /include/xtensa-isa-internal.h | |
parent | 8cb1c2c857aa176a410126b4dc01d6fceaf21356 (diff) | |
download | gdb-61d2295d723c7d202f530ccca1eacb4cfedf06d9.zip gdb-61d2295d723c7d202f530ccca1eacb4cfedf06d9.tar.gz gdb-61d2295d723c7d202f530ccca1eacb4cfedf06d9.tar.bz2 |
xtensa constify
Move lots of read-only arrays to .rodata.
include/
* xtensa-isa-internal.h (xtensa_format_internal),
(xtensa_slot_internal, xtensa_operand_internal),
(xtensa_arg_internal, xtensa_iclass_internal),
(xtensa_opcode_internal, xtensa_regfile_internal),
(xtensa_interface_internal, xtensa_funcUnit_internal),
(xtensa_state_internal, xtensa_sysreg_internal): Constify.
bfd/
* elf32-xtensa.c (narrowable, widenable): Constify.
* xtensa-modules.c: Constify many arrays.
Diffstat (limited to 'include/xtensa-isa-internal.h')
-rw-r--r-- | include/xtensa-isa-internal.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/xtensa-isa-internal.h b/include/xtensa-isa-internal.h index 4e7ccd3..cf1e8a3 100644 --- a/include/xtensa-isa-internal.h +++ b/include/xtensa-isa-internal.h @@ -53,29 +53,29 @@ typedef void (*xtensa_opcode_encode_fn) (xtensa_insnbuf); typedef int (*xtensa_format_decode_fn) (const xtensa_insnbuf); typedef int (*xtensa_length_decode_fn) (const unsigned char *); -typedef struct xtensa_format_internal_struct +typedef const struct xtensa_format_internal_struct { const char *name; /* Instruction format name. */ int length; /* Instruction length in bytes. */ xtensa_format_encode_fn encode_fn; int num_slots; - int *slot_id; /* Array[num_slots] of slot IDs. */ + const int *slot_id; /* Array[num_slots] of slot IDs. */ } xtensa_format_internal; -typedef struct xtensa_slot_internal_struct +typedef const struct xtensa_slot_internal_struct { const char *name; /* Not necessarily unique. */ const char *format; int position; xtensa_get_slot_fn get_fn; xtensa_set_slot_fn set_fn; - xtensa_get_field_fn *get_field_fns; /* Array[field_id]. */ - xtensa_set_field_fn *set_field_fns; /* Array[field_id]. */ + const xtensa_get_field_fn *get_field_fns; /* Array[field_id]. */ + const xtensa_set_field_fn *set_field_fns; /* Array[field_id]. */ xtensa_opcode_decode_fn opcode_decode_fn; const char *nop_name; } xtensa_slot_internal; -typedef struct xtensa_operand_internal_struct +typedef const struct xtensa_operand_internal_struct { const char *name; int field_id; @@ -88,7 +88,7 @@ typedef struct xtensa_operand_internal_struct xtensa_undo_reloc_fn undo_reloc; /* Undo a PC-relative relocation. */ } xtensa_operand_internal; -typedef struct xtensa_arg_internal_struct +typedef const struct xtensa_arg_internal_struct { union { int operand_id; /* For normal operands. */ @@ -97,7 +97,7 @@ typedef struct xtensa_arg_internal_struct char inout; /* Direction: 'i', 'o', or 'm'. */ } xtensa_arg_internal; -typedef struct xtensa_iclass_internal_struct +typedef const struct xtensa_iclass_internal_struct { int num_operands; /* Size of "operands" array. */ xtensa_arg_internal *operands; /* Array[num_operands]. */ @@ -109,17 +109,17 @@ typedef struct xtensa_iclass_internal_struct xtensa_interface *interfaceOperands; /* Array[num_interfaceOperands]. */ } xtensa_iclass_internal; -typedef struct xtensa_opcode_internal_struct +typedef const struct xtensa_opcode_internal_struct { const char *name; /* Opcode mnemonic. */ int iclass_id; /* Iclass for this opcode. */ uint32 flags; /* See XTENSA_OPCODE_* flags. */ - xtensa_opcode_encode_fn *encode_fns; /* Array[slot_id]. */ + const xtensa_opcode_encode_fn *encode_fns; /* Array[slot_id]. */ int num_funcUnit_uses; /* Number of funcUnit_use entries. */ xtensa_funcUnit_use *funcUnit_uses; /* Array[num_funcUnit_uses]. */ } xtensa_opcode_internal; -typedef struct xtensa_regfile_internal_struct +typedef const struct xtensa_regfile_internal_struct { const char *name; /* Full name of the regfile. */ const char *shortname; /* Abbreviated name. */ @@ -128,7 +128,7 @@ typedef struct xtensa_regfile_internal_struct int num_entries; /* Number of registers. */ } xtensa_regfile_internal; -typedef struct xtensa_interface_internal_struct +typedef const struct xtensa_interface_internal_struct { const char *name; /* Interface name. */ int num_bits; /* Width of the interface. */ @@ -137,20 +137,20 @@ typedef struct xtensa_interface_internal_struct char inout; /* "i" or "o". */ } xtensa_interface_internal; -typedef struct xtensa_funcUnit_internal_struct +typedef const struct xtensa_funcUnit_internal_struct { const char *name; /* Functional unit name. */ int num_copies; /* Number of instances. */ } xtensa_funcUnit_internal; -typedef struct xtensa_state_internal_struct +typedef const struct xtensa_state_internal_struct { const char *name; /* State name. */ int num_bits; /* Number of state bits. */ uint32 flags; /* See XTENSA_STATE_* flags. */ } xtensa_state_internal; -typedef struct xtensa_sysreg_internal_struct +typedef const struct xtensa_sysreg_internal_struct { const char *name; /* Register name. */ int number; /* Register number. */ |