opcodes: tic54x: namespace exported variables
authorMike Frysinger <vapier@gentoo.org>
Sat, 16 Jan 2021 06:00:45 +0000 (01:00 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 8 Feb 2021 23:26:08 +0000 (18:26 -0500)
The tic54x exports some fairly generic variable names that can
conflict with programs that use them, so put proper tic54x_
prefixes on all of them.

gas/ChangeLog
gas/config/tc-tic54x.c
include/ChangeLog
include/opcode/tic54x.h
opcodes/ChangeLog
opcodes/tic54x-dis.c
opcodes/tic54x-opc.c

index 83b2721c293b62de1958b093b9447734569d9386..ed343afd2d877e18d249379ef0c16cc0055e191b 100644 (file)
@@ -1,3 +1,11 @@
+2021-02-08  Mike Frysinger  <vapier@gentoo.org>
+
+       * config/tc-tic54x (tic54x_mmregs): Rename to ...
+       (tic54x_register_mmregs): ... this.  Change mmregs to tic54x_mmregs.
+       (md_pseudo_table): Change tic54x_mmregs to tic54x_register_mmregs.
+       (md_begin): Add tic54x_ prefix to regs, mmregs, condition_codes,
+       cc2_codes, cc3_codes, status_bits, and misc_symbols.
+
 2021-02-08  Nick Clifton  <nickc@redhat.com>
 
        PR 27355
index 5a6bc8aa7dc67b1b02afe0f400223dc97088d794..da2c755946c6587070d6fb73053cbf762e372cad 100644 (file)
@@ -2007,13 +2007,13 @@ tic54x_label (int ignored ATTRIBUTE_UNUSED)
    absolute local symbols.  */
 
 static void
-tic54x_mmregs (int ignored ATTRIBUTE_UNUSED)
+tic54x_register_mmregs (int ignored ATTRIBUTE_UNUSED)
 {
-  tic54x_symbol *sym;
+  const tic54x_symbol *sym;
 
   ILLEGAL_WITHIN_STRUCT ();
 
-  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
+  for (sym = tic54x_mmregs; sym->name; sym++)
     {
       symbolS *symbolP = symbol_new (sym->name, absolute_section,
                                     &zero_address_frag, sym->value);
@@ -2421,7 +2421,7 @@ const pseudo_typeS md_pseudo_table[] =
   { "mlib"     , tic54x_mlib              ,          0 },
   { "mlist"    , s_ignore                 ,          0 },
   { "mnolist"  , s_ignore                 ,          0 },
-  { "mmregs"   , tic54x_mmregs            ,          0 },
+  { "mmregs"   , tic54x_register_mmregs   ,          0 },
   { "newblock" , tic54x_clear_local_labels,          0 },
   { "option"   , s_ignore                 ,          0 },
   { "p2align"  , tic54x_p2align           ,          0 },
@@ -2965,10 +2965,10 @@ void
 md_begin (void)
 {
   insn_template *tm;
-  tic54x_symbol *sym;
+  const tic54x_symbol *sym;
   const subsym_proc_entry *subsym_proc;
   const math_proc_entry *math_proc;
-  char **symname;
+  const char **symname;
   char *TIC54X_DIR = getenv ("TIC54X_DIR");
   char *A_DIR = TIC54X_DIR ? TIC54X_DIR : getenv ("A_DIR");
 
@@ -3000,7 +3000,7 @@ md_begin (void)
     str_hash_insert (parop_hash, tm->name, tm, 0);
 
   reg_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) regs; sym->name; sym++)
+  for (sym = tic54x_regs; sym->name; sym++)
     {
       /* Add basic registers to the symbol table.  */
       symbolS *symbolP = symbol_new (sym->name, absolute_section,
@@ -3009,30 +3009,30 @@ md_begin (void)
       symbol_table_insert (symbolP);
       str_hash_insert (reg_hash, sym->name, sym, 0);
     }
-  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
+  for (sym = tic54x_mmregs; sym->name; sym++)
     str_hash_insert (reg_hash, sym->name, sym, 0);
   mmreg_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) mmregs; sym->name; sym++)
+  for (sym = tic54x_mmregs; sym->name; sym++)
     str_hash_insert (mmreg_hash, sym->name, sym, 0);
 
   cc_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) condition_codes; sym->name; sym++)
+  for (sym = tic54x_condition_codes; sym->name; sym++)
     str_hash_insert (cc_hash, sym->name, sym, 0);
 
   cc2_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) cc2_codes; sym->name; sym++)
+  for (sym = tic54x_cc2_codes; sym->name; sym++)
     str_hash_insert (cc2_hash, sym->name, sym, 0);
 
   cc3_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) cc3_codes; sym->name; sym++)
+  for (sym = tic54x_cc3_codes; sym->name; sym++)
     str_hash_insert (cc3_hash, sym->name, sym, 0);
 
   sbit_hash = str_htab_create ();
-  for (sym = (tic54x_symbol *) status_bits; sym->name; sym++)
+  for (sym = tic54x_status_bits; sym->name; sym++)
     str_hash_insert (sbit_hash, sym->name, sym, 0);
 
   misc_symbol_hash = str_htab_create ();
-  for (symname = (char **) misc_symbols; *symname; symname++)
+  for (symname = tic54x_misc_symbols; *symname; symname++)
     str_hash_insert (misc_symbol_hash, *symname, *symname, 0);
 
   /* Only the base substitution table and local label table are initialized;
index 09a3ad960ea82a7200b77e48e1132c6ce39307a9..18237b5f9c4c29a821fc6bf69a4a27627a635506 100644 (file)
@@ -1,3 +1,20 @@
+2021-02-08  Mike Frysinger  <vapier@gentoo.org>
+
+       * opcode/tic54x.h (mmregs): Rename to ...
+       (tic54x_mmregs): ... this.
+       (regs): Rename to ...
+       (tic54x_regs): ... this.
+       (condition_codes): Rename to ...
+       (tic54x_condition_codes): ... this.
+       (cc2_codes): Rename to ...
+       (tic54x_cc2_codes): ... this.
+       (status_bits): Rename to ...
+       (tic54x_status_bits): ... this.
+       (cc3_codes): Rename to ...
+       (tic54x_cc3_codes): ... this.
+       (misc_symbols): Rename to ...
+       (tic54x_misc_symbols): ... this.
+
 2021-02-05  Nelson Chu  <nelson.chu@sifive.com>
 
        PR 27348
index 8e0dd7e759020b6439cdd88c134ce260849f4490..4567ca89cc0e0b9298aaa94fffd3a5c2edaa5a23 100644 (file)
@@ -152,10 +152,10 @@ typedef struct _template
 extern const insn_template tic54x_unknown_opcode;
 extern const insn_template tic54x_optab[];
 extern const insn_template tic54x_paroptab[];
-extern const tic54x_symbol mmregs[], regs[];
-extern const tic54x_symbol condition_codes[], cc2_codes[], status_bits[];
-extern const tic54x_symbol cc3_codes[];
-extern const char *misc_symbols[];
+extern const tic54x_symbol tic54x_mmregs[], tic54x_regs[];
+extern const tic54x_symbol tic54x_condition_codes[], tic54x_cc2_codes[];
+extern const tic54x_symbol tic54x_status_bits[], tic54x_cc3_codes[];
+extern const char *tic54x_misc_symbols[];
 struct disassemble_info;
 extern const insn_template* tic54x_get_insn (struct disassemble_info *, 
                                         bfd_vma, unsigned short, int *);
index 95ec07166f49a4896ae2642b7da5bcf686bef6ef..24d063a23890b71fabd6c279d27cc1a999db39aa 100644 (file)
@@ -1,3 +1,21 @@
+2021-02-08  Mike Frysinger  <vapier@gentoo.org>
+
+       * tic54x-dis.c (sprint_mmr): Change to tic54x_mmregs.
+       * tic54x-opc.c (regs): Rename to ...
+       (tic54x_regs): ... this.
+       (mmregs): Rename to ...
+       (tic54x_mmregs): ... this.
+       (condition_codes): Rename to ...
+       (tic54x_condition_codes): ... this.
+       (cc2_codes): Rename to ...
+       (tic54x_cc2_codes): ... this.
+       (cc3_codes): Rename to ...
+       (tic54x_cc3_codes): ... this.
+       (status_bits): Rename to ...
+       (tic54x_status_bits): ... this.
+       (misc_symbols): Rename to ...
+       (tic54x_misc_symbols): ... this.
+
 2021-02-04  Nelson Chu  <nelson.chu@sifive.com>
 
        * riscv-opc.c (MASK_RVB_IMM): Removed.
index 85309eaded9e77ab47ffcaa3a592309f09a4e2a9..5bf9a58f8eb7103f0b90addce067f10671585dba 100644 (file)
@@ -529,7 +529,7 @@ sprint_mmr (disassemble_info *info ATTRIBUTE_UNUSED,
            char buf[],
            int mmr)
 {
-  tic54x_symbol *reg = (tic54x_symbol *) mmregs;
+  const tic54x_symbol *reg = tic54x_mmregs;
   while (reg->name != NULL)
     {
       if (mmr == reg->value)
index 6ed2cb8d8874ad714c581b016a709f1dce92c463..411460c07edf8b20a97c77157c8aaa5061402a76 100644 (file)
@@ -24,7 +24,7 @@
 #include "opcode/tic54x.h"
 
 /* these are the only register names not found in mmregs */
-const tic54x_symbol regs[] = {
+const tic54x_symbol tic54x_regs[] = {
   { "AR0", 16 },                  { "ar0", 16 },
   { "AR1", 17 },                  { "ar1", 17 },
   { "AR2", 18 },                  { "ar2", 18 },
@@ -38,7 +38,7 @@ const tic54x_symbol regs[] = {
 
 /* status bits, MM registers, condition codes, etc */
 /* some symbols are only valid for certain chips... */
-const tic54x_symbol mmregs[] = {
+const tic54x_symbol tic54x_mmregs[] = {
   { "IMR", 0 },                   { "imr", 0 },
   { "IFR", 1 },                   { "ifr", 1 },
   { "ST0", 6 },                   { "st0", 6 },
@@ -111,7 +111,7 @@ const tic54x_symbol mmregs[] = {
   { NULL, 0},
 };
 
-const tic54x_symbol condition_codes[] = {
+const tic54x_symbol tic54x_condition_codes[] = {
   /* condition codes */
   { "UNC",  0 },                { "unc",  0 },
 #define CC1   0x40
@@ -155,7 +155,7 @@ const tic54x_symbol condition_codes[] = {
   { NULL, 0 }
 };
 
-const tic54x_symbol cc2_codes[] = {
+const tic54x_symbol tic54x_cc2_codes[] = {
   { "UNC", 0 },  { "unc", 0 },
   { "AEQ", 5 },  { "aeq", 5 },
   { "ANEQ", 4 }, { "aneq", 4 },
@@ -172,7 +172,7 @@ const tic54x_symbol cc2_codes[] = {
   { NULL, 0 },
 };
 
-const tic54x_symbol cc3_codes[] = {
+const tic54x_symbol tic54x_cc3_codes[] = {
   { "EQ", 0x0000 },  { "eq", 0x0000 },
   { "LT", 0x0100 },  { "lt", 0x0100 },
   { "GT", 0x0200 },  { "gt", 0x0200 },
@@ -189,7 +189,7 @@ const tic54x_symbol cc3_codes[] = {
 };
 
 /* FIXME -- also allow decimal digits */
-const tic54x_symbol status_bits[] = {
+const tic54x_symbol tic54x_status_bits[] = {
   /* status register 0 */
   { "TC",  12 },                { "tc",  12 },
   { "C",   11 },                { "c",   11 },
@@ -209,7 +209,7 @@ const tic54x_symbol status_bits[] = {
   { NULL, 0 },
 };
 
-const char *misc_symbols[] = {
+const char *tic54x_misc_symbols[] = {
   "ARP", "arp",
   "DP",  "dp",
   "ASM", "asm",
This page took 0.034908 seconds and 4 git commands to generate.