HV: HV: make io_read_fn_t return true or false

This patch makes io_read_fn_t return true or false instead of void.
Returning true means that the handler in HV process the request completely.
Returning false means that we need to re-inject the request to DM after
processing it in HV.

Tracked-On: #2865
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
This commit is contained in:
Kaige Fu
2019-03-28 16:23:30 +00:00
committed by ACRN System Integration
parent 3b2ad67788
commit 1c0d7f78d0
7 changed files with 54 additions and 31 deletions

View File

@@ -248,12 +248,13 @@ done:
return true;
}
static uint32_t vuart_read(struct acrn_vm *vm, uint16_t offset_arg,
static bool vuart_read(struct acrn_vm *vm, struct acrn_vcpu *vcpu, uint16_t offset_arg,
__unused size_t width)
{
uint16_t offset = offset_arg;
uint8_t iir, reg, intr_reason;
struct acrn_vuart *vu = vm_vuart(vm);
struct pio_request *pio_req = &vcpu->req.reqs.pio;
offset -= vu->base;
vuart_lock(vu);
@@ -323,8 +324,10 @@ static uint32_t vuart_read(struct acrn_vm *vm, uint16_t offset_arg,
}
done:
vuart_toggle_intr(vu);
pio_req->value = (uint32_t)reg;
vuart_unlock(vu);
return (uint32_t)reg;
return true;
}
static void vuart_register_io_handler(struct acrn_vm *vm)