qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

mos6522: remove anh register

Register addr 1 is defined as buffer A with handshake (vBufAH),
register addr 15 is also defined as buffer A without handshake (vBufA).

As both addresses access the same register, remove the definition of
'anh' and use only 'a' (with VIA_REG_ANH and VIA_REG_A).

Fixes: 51f233ec92cd ("misc: introduce new mos6522 VIA device and enable it for ppc builds")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20191220214054.76525-1-laurent@vivier.eu>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

authored by

Laurent Vivier and committed by
David Gibson
068fe58c 8f06e370

+8 -9
+8 -8
hw/misc/mos6522.c
··· 244 244 val = s->b; 245 245 break; 246 246 case VIA_REG_A: 247 + qemu_log_mask(LOG_UNIMP, "Read access to register A with handshake"); 248 + /* fall through */ 249 + case VIA_REG_ANH: 247 250 val = s->a; 248 251 break; 249 252 case VIA_REG_DIRB: ··· 297 300 val = s->ier | 0x80; 298 301 break; 299 302 default: 300 - case VIA_REG_ANH: 301 - val = s->anh; 302 - break; 303 + g_assert_not_reached(); 303 304 } 304 305 305 306 if (addr != VIA_REG_IFR || val != 0) { ··· 322 323 mdc->portB_write(s); 323 324 break; 324 325 case VIA_REG_A: 326 + qemu_log_mask(LOG_UNIMP, "Write access to register A with handshake"); 327 + /* fall through */ 328 + case VIA_REG_ANH: 325 329 s->a = (s->a & ~s->dira) | (val & s->dira); 326 330 mdc->portA_write(s); 327 331 break; ··· 395 399 qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)); 396 400 break; 397 401 default: 398 - case VIA_REG_ANH: 399 - s->anh = val; 400 - break; 402 + g_assert_not_reached(); 401 403 } 402 404 } 403 405 ··· 439 441 VMSTATE_UINT8(pcr, MOS6522State), 440 442 VMSTATE_UINT8(ifr, MOS6522State), 441 443 VMSTATE_UINT8(ier, MOS6522State), 442 - VMSTATE_UINT8(anh, MOS6522State), 443 444 VMSTATE_STRUCT_ARRAY(timers, MOS6522State, 2, 0, 444 445 vmstate_mos6522_timer, MOS6522Timer), 445 446 VMSTATE_END_OF_LIST() ··· 460 461 s->ifr = 0; 461 462 s->ier = 0; 462 463 /* s->ier = T1_INT | SR_INT; */ 463 - s->anh = 0; 464 464 465 465 s->timers[0].frequency = s->frequency; 466 466 s->timers[0].latch = 0xffff;
-1
include/hw/misc/mos6522.h
··· 115 115 uint8_t pcr; 116 116 uint8_t ifr; 117 117 uint8_t ier; 118 - uint8_t anh; 119 118 120 119 MOS6522Timer timers[2]; 121 120 uint64_t frequency;