提交 563ea489 编写于 作者: R Richard Henderson 提交者: Avi Kivity

memory: Fix old_portio vs non-zero offset

The legacy functions that we're wrapping expect that offset
to be included in the register.  Indeed, they generally
expect the absolute address and then mask off the "high" bits.

The FDC is the first converted device with a non-zero offset.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 a5e1cbc8
......@@ -396,7 +396,7 @@ static void memory_region_iorange_read(IORange *iorange,
*data = ((uint64_t)1 << (width * 8)) - 1;
if (mrp) {
*data = mrp->read(mr->opaque, offset - mrp->offset);
*data = mrp->read(mr->opaque, offset);
}
return;
}
......@@ -418,7 +418,7 @@ static void memory_region_iorange_write(IORange *iorange,
const MemoryRegionPortio *mrp = find_portio(mr, offset, width, true);
if (mrp) {
mrp->write(mr->opaque, offset - mrp->offset, data);
mrp->write(mr->opaque, offset, data);
}
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册