static uint32_t tnetw1130_mem0_readl(void *opaque, target_phys_addr_t addr) { pci_tnetw1130_t *d = (pci_tnetw1130_t *) opaque; tnetw1130_t *s = &d->tnetw1130; addr -= s->region[0]; return tnetw1130_read0l(d, addr); }
static uint64_t tnetw1130_read0(void *opaque, hwaddr addr, unsigned size) { TNETW1130State *d = opaque; tnetw1130_t *s = &d->tnetw1130; uint64_t val = 0; switch (size) { case 1: val = tnetw1130_read0b(s, addr); break; case 2: val = tnetw1130_read0w(s, addr); break; case 4: val = tnetw1130_read0l(s, addr); break; default: assert(!"bad size"); } return val; }