Commit 1983a3956ce8c37a32de09976c65187bf3d4478b
1 parent
c0b24a1d
ASI printing (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1571 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
62 additions
and
13 deletions
sparc-dis.c
| @@ -2102,7 +2102,55 @@ lookup_value (table, value) | @@ -2102,7 +2102,55 @@ lookup_value (table, value) | ||
| 2102 | 2102 | ||
| 2103 | /* Handle ASI's. */ | 2103 | /* Handle ASI's. */ |
| 2104 | 2104 | ||
| 2105 | -static arg asi_table[] = | 2105 | +static const arg asi_table_v8[] = |
| 2106 | +{ | ||
| 2107 | + { 0x00, "#ASI_M_RES00" }, | ||
| 2108 | + { 0x01, "#ASI_M_UNA01" }, | ||
| 2109 | + { 0x02, "#ASI_M_MXCC" }, | ||
| 2110 | + { 0x03, "#ASI_M_FLUSH_PROBE" }, | ||
| 2111 | + { 0x04, "#ASI_M_MMUREGS" }, | ||
| 2112 | + { 0x05, "#ASI_M_TLBDIAG" }, | ||
| 2113 | + { 0x06, "#ASI_M_DIAGS" }, | ||
| 2114 | + { 0x07, "#ASI_M_IODIAG" }, | ||
| 2115 | + { 0x08, "#ASI_M_USERTXT" }, | ||
| 2116 | + { 0x09, "#ASI_M_KERNELTXT" }, | ||
| 2117 | + { 0x0A, "#ASI_M_USERDATA" }, | ||
| 2118 | + { 0x0B, "#ASI_M_KERNELDATA" }, | ||
| 2119 | + { 0x0C, "#ASI_M_TXTC_TAG" }, | ||
| 2120 | + { 0x0D, "#ASI_M_TXTC_DATA" }, | ||
| 2121 | + { 0x0E, "#ASI_M_DATAC_TAG" }, | ||
| 2122 | + { 0x0F, "#ASI_M_DATAC_DATA" }, | ||
| 2123 | + { 0x10, "#ASI_M_FLUSH_PAGE" }, | ||
| 2124 | + { 0x11, "#ASI_M_FLUSH_SEG" }, | ||
| 2125 | + { 0x12, "#ASI_M_FLUSH_REGION" }, | ||
| 2126 | + { 0x13, "#ASI_M_FLUSH_CTX" }, | ||
| 2127 | + { 0x14, "#ASI_M_FLUSH_USER" }, | ||
| 2128 | + { 0x17, "#ASI_M_BCOPY" }, | ||
| 2129 | + { 0x18, "#ASI_M_IFLUSH_PAGE" }, | ||
| 2130 | + { 0x19, "#ASI_M_IFLUSH_SEG" }, | ||
| 2131 | + { 0x1A, "#ASI_M_IFLUSH_REGION" }, | ||
| 2132 | + { 0x1B, "#ASI_M_IFLUSH_CTX" }, | ||
| 2133 | + { 0x1C, "#ASI_M_IFLUSH_USER" }, | ||
| 2134 | + { 0x1F, "#ASI_M_BFILL" }, | ||
| 2135 | + { 0x20, "#ASI_M_BYPASS" }, | ||
| 2136 | + { 0x29, "#ASI_M_FBMEM" }, | ||
| 2137 | + { 0x2A, "#ASI_M_VMEUS" }, | ||
| 2138 | + { 0x2B, "#ASI_M_VMEPS" }, | ||
| 2139 | + { 0x2C, "#ASI_M_VMEUT" }, | ||
| 2140 | + { 0x2D, "#ASI_M_VMEPT" }, | ||
| 2141 | + { 0x2E, "#ASI_M_SBUS" }, | ||
| 2142 | + { 0x2F, "#ASI_M_CTL" }, | ||
| 2143 | + { 0x31, "#ASI_M_FLUSH_IWHOLE" }, | ||
| 2144 | + { 0x36, "#ASI_M_IC_FLCLEAR" }, | ||
| 2145 | + { 0x37, "#ASI_M_DC_FLCLEAR" }, | ||
| 2146 | + { 0x39, "#ASI_M_DCDR" }, | ||
| 2147 | + { 0x40, "#ASI_M_VIKING_TMP1" }, | ||
| 2148 | + { 0x41, "#ASI_M_VIKING_TMP2" }, | ||
| 2149 | + { 0x4c, "#ASI_M_ACTION" }, | ||
| 2150 | + { 0, 0 } | ||
| 2151 | +}; | ||
| 2152 | + | ||
| 2153 | +static const arg asi_table_v9[] = | ||
| 2106 | { | 2154 | { |
| 2107 | /* These are in the v9 architecture manual. */ | 2155 | /* These are in the v9 architecture manual. */ |
| 2108 | /* The shorter versions appear first, they're here because Sun's as has them. | 2156 | /* The shorter versions appear first, they're here because Sun's as has them. |
| @@ -2142,22 +2190,18 @@ static arg asi_table[] = | @@ -2142,22 +2190,18 @@ static arg asi_table[] = | ||
| 2142 | { 0, 0 } | 2190 | { 0, 0 } |
| 2143 | }; | 2191 | }; |
| 2144 | 2192 | ||
| 2145 | -/* Return the value for ASI NAME, or -1 if not found. */ | 2193 | +/* Return the name for ASI value VALUE or NULL if not found. */ |
| 2146 | 2194 | ||
| 2147 | -int | ||
| 2148 | -sparc_encode_asi (name) | ||
| 2149 | - const char *name; | 2195 | +static const char * |
| 2196 | +sparc_decode_asi_v9 (int value) | ||
| 2150 | { | 2197 | { |
| 2151 | - return lookup_name (asi_table, name); | 2198 | + return lookup_value (asi_table_v9, value); |
| 2152 | } | 2199 | } |
| 2153 | 2200 | ||
| 2154 | -/* Return the name for ASI value VALUE or NULL if not found. */ | ||
| 2155 | - | ||
| 2156 | -const char * | ||
| 2157 | -sparc_decode_asi (value) | ||
| 2158 | - int value; | 2201 | +static const char * |
| 2202 | +sparc_decode_asi_v8 (int value) | ||
| 2159 | { | 2203 | { |
| 2160 | - return lookup_value (asi_table, value); | 2204 | + return lookup_value (asi_table_v8, value); |
| 2161 | } | 2205 | } |
| 2162 | 2206 | ||
| 2163 | /* Handle membar masks. */ | 2207 | /* Handle membar masks. */ |
| @@ -2841,7 +2885,12 @@ print_insn_sparc (memaddr, info) | @@ -2841,7 +2885,12 @@ print_insn_sparc (memaddr, info) | ||
| 2841 | 2885 | ||
| 2842 | case 'A': | 2886 | case 'A': |
| 2843 | { | 2887 | { |
| 2844 | - const char *name = sparc_decode_asi (X_ASI (insn)); | 2888 | + const char *name; |
| 2889 | + | ||
| 2890 | + if (info->mach == bfd_mach_sparc_v9) | ||
| 2891 | + name = sparc_decode_asi_v9 (X_ASI (insn)); | ||
| 2892 | + else | ||
| 2893 | + name = sparc_decode_asi_v8 (X_ASI (insn)); | ||
| 2845 | 2894 | ||
| 2846 | if (name) | 2895 | if (name) |
| 2847 | (*info->fprintf_func) (stream, "%s", name); | 2896 | (*info->fprintf_func) (stream, "%s", name); |