mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
qemu-usb: respect size of assignment
fixes vbox4 and vbox5 xhci support Issue #2362
This commit is contained in:
parent
e3d8b6098f
commit
760c04c53a
@ -556,8 +556,8 @@ struct Controller : public Qemu::Controller
|
||||
ptr = (void*)&Object_pool::p()->xhci_state()->ports[port];
|
||||
}
|
||||
|
||||
uint64_t v = mmio.ops->read(ptr, reg, size);
|
||||
*((uint32_t*)buf) = v;
|
||||
uint64_t v = mmio.ops->read(ptr, reg, size);
|
||||
memcpy(buf, &v, Genode::min(sizeof(v), size));
|
||||
|
||||
if (verbose_mmio)
|
||||
Genode::log(__func__, ": ", Hex(mmio.id), " offset: ", Hex(offset), " "
|
||||
@ -571,9 +571,10 @@ struct Controller : public Qemu::Controller
|
||||
Genode::Lock::Guard g(_lock);
|
||||
Mmio &mmio = find_region(offset);
|
||||
Genode::off_t reg = offset - mmio.offset;
|
||||
uint64_t v = *((uint64_t*)buf);
|
||||
void *ptr = Object_pool::p()->xhci_state();
|
||||
uint64_t v = 0ULL;
|
||||
|
||||
void *ptr = Object_pool::p()->xhci_state();
|
||||
memcpy(&v, buf, Genode::min(sizeof(v), size));
|
||||
|
||||
/*
|
||||
* Handle port access
|
||||
|
Loading…
x
Reference in New Issue
Block a user