- }
- else if (tex_cb & 0x10) { // TEX[2] set
- sprintf(buf, "inner-%s-outer-%s",
- cache_attrs4[tex_cb & 3], cache_attrs4[(tex_cb >> 2) & 3]);
- }
- else {
- switch (tex_cb) {
- case 0x00: sprintf(buf, "strongly-ordered"); s = 1; break;
- case 0x01: sprintf(buf, "shareable-device"); s = 1; break;
- case 0x02: sprintf(buf, "inner-outer-WT-noWA"); break;
- case 0x03: sprintf(buf, "inner-outer-WB-noWA"); break;
- case 0x04: sprintf(buf, "inner-outer-non-cacheable"); break;
- case 0x06: sprintf(buf, "implementation-defined"); break;
- case 0x07: sprintf(buf, "inner-outer-WB-WA"); break;
- case 0x08: sprintf(buf, "non-shareable-device"); s = 0; break;
- default: sprintf(buf, "reserved"); break;
+
+do_tex_cb:
+ if (control & (1 << 28)) { // TEX remap
+ // S (shareable) bit remapping
+ char s_normal[2] = { (prrr >> 18) & 1, (prrr >> 19) & 1 };
+ char s_device[2] = { (prrr >> 16) & 1, (prrr >> 17) & 1 };
+
+ buf[0] = 0;
+ tex_cb &= 7;
+ type = (prrr >> tex_cb * 2) & 3;
+ switch (type) {
+ case 0:
+ sprintf(buf, "strongly-ordered");
+ break;
+ case 1:
+ sprintf(buf, "device");
+ s = s_device[s];
+ break;
+ case 3:
+ sprintf(buf, "reserved/normal");
+ case 2:
+ s = s_normal[s];
+ sprintf(buf + strlen(buf), "inner-%s-outer-%s",
+ cache_attrs4[(nmrr >> tex_cb * 2) & 3],
+ cache_attrs4[(nmrr >> (tex_cb * 2 + 16)) & 3]);
+ }
+ }
+ else if (tex_cb & 0x10) { // TEX[2] set
+ sprintf(buf, "inner-%s-outer-%s",
+ cache_attrs4[tex_cb & 3], cache_attrs4[(tex_cb >> 2) & 3]);
+ }
+ else {
+ switch (tex_cb) {
+ case 0x00: sprintf(buf, "strongly-ordered"); s = 1; break;
+ case 0x01: sprintf(buf, "shareable-device"); s = 1; break;
+ case 0x02: sprintf(buf, "inner-outer-WT-noWA"); break;
+ case 0x03: sprintf(buf, "inner-outer-WB-noWA"); break;
+ case 0x04: sprintf(buf, "inner-outer-non-cacheable"); break;
+ case 0x06: sprintf(buf, "implementation-defined"); break;
+ case 0x07: sprintf(buf, "inner-outer-WB-WA"); break;
+ case 0x08: sprintf(buf, "non-shareable-device"); s = 0; break;
+ default: sprintf(buf, "reserved"); break;
+ }