On 2011-09-18 17:37, Avi Kivity wrote: > On 09/18/2011 03:51 PM, Jan Kiszka wrote: >> From: Jan Kiszka<jan.kis...@siemens.com> >> >> As we register old portio regions via ioport_register, we are also >> responsible for providing the word access wrapper. >> >> Signed-off-by: Jan Kiszka<jan.kis...@siemens.com> >> --- >> >> Oops, was lacking a shift for word reads. >> >> memory.c | 10 ++++++++++ >> 1 files changed, 10 insertions(+), 0 deletions(-) >> >> diff --git a/memory.c b/memory.c >> index b3ee232..aef4702 100644 >> --- a/memory.c >> +++ b/memory.c >> @@ -397,6 +397,11 @@ static void memory_region_iorange_read(IORange >> *iorange, >> *data = ((uint64_t)1<< (width * 8)) - 1; >> if (mrp) { >> *data = mrp->read(mr->opaque, offset + mr->offset); >> + } else if (width == 2) { >> + mrp = find_portio(mr, offset, 1, false); >> + assert(mrp); >> + *data = mrp->read(mr->opaque, offset + mr->offset) | >> + (mrp->read(mr->opaque, offset + mr->offset + >> 1)<< 8); >> } > > What about width 4?
This is PIO, limited by the x86 address space to 16 bit. Will add a comment. > Why not use access_with_adjusted_size()? Because of different accessor prototypes. Jan
signature.asc
Description: OpenPGP digital signature