Revision c353e4cc
b/exec.c | ||
---|---|---|
1558 | 1558 |
io_mem_write(section->mr, addr, value, len); |
1559 | 1559 |
} |
1560 | 1560 |
|
1561 |
static bool subpage_accepts(void *opaque, hwaddr addr, |
|
1562 |
unsigned size, bool is_write) |
|
1563 |
{ |
|
1564 |
subpage_t *mmio = opaque; |
|
1565 |
unsigned int idx = SUBPAGE_IDX(addr); |
|
1566 |
MemoryRegionSection *section; |
|
1567 |
#if defined(DEBUG_SUBPAGE) |
|
1568 |
printf("%s: subpage %p %c len %d addr " TARGET_FMT_plx |
|
1569 |
" idx %d\n", __func__, mmio, |
|
1570 |
is_write ? 'w' : 'r', len, addr, idx); |
|
1571 |
#endif |
|
1572 |
|
|
1573 |
section = &phys_sections[mmio->sub_section[idx]]; |
|
1574 |
addr += mmio->base; |
|
1575 |
addr -= section->offset_within_address_space; |
|
1576 |
addr += section->offset_within_region; |
|
1577 |
return memory_region_access_valid(section->mr, addr, size, is_write); |
|
1578 |
} |
|
1579 |
|
|
1561 | 1580 |
static const MemoryRegionOps subpage_ops = { |
1562 | 1581 |
.read = subpage_read, |
1563 | 1582 |
.write = subpage_write, |
1583 |
.valid.accepts = subpage_accepts, |
|
1564 | 1584 |
.endianness = DEVICE_NATIVE_ENDIAN, |
1565 | 1585 |
}; |
1566 | 1586 |
|
Also available in: Unified diff