hv:Replace vuart pointer with instance in structure vm

-- update 'vuart' field in 'struct vm' from pointer
   to instance
-- replace MACRO with inline function for vm_vuart,
   and move it to vm.h
-- change vuart_init to void type
-- rename struct vuart -->struct acrn_vuart

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-08-22 15:42:46 +08:00
committed by lijinxia
parent 0b54946bac
commit 29dbd1084d
9 changed files with 53 additions and 64 deletions

View File

@@ -46,8 +46,7 @@ is_entry_active(struct ptdev_remapping_info *entry)
static bool ptdev_hv_owned_intx(struct vm *vm, union source_id *virt_sid)
{
/* vm0 pin 4 (uart) is owned by hypervisor under debug version */
if (is_vm0(vm) && (vm->vuart != NULL) &&
(virt_sid->intx_id.pin == 4U)) {
if (is_vm0(vm) && (virt_sid->intx_id.pin == 4U)) {
return true;
} else {
return false;

View File

@@ -199,14 +199,14 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
}
/* Create virtual uart */
vm->vuart = vuart_init(vm);
vuart_init(vm);
}
vpic_init(vm);
#ifdef CONFIG_PARTITION_MODE
/* Create virtual uart */
if (vm_desc->vm_vuart) {
vm->vuart = vuart_init(vm);
vuart_init(vm);
}
vrtc_init(vm);
vpci_init(vm);