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

@@ -133,7 +133,7 @@ struct vm {
struct vm_pm_info pm; /* Reference to this VM's arch information */
struct vm_arch arch_vm; /* Reference to this VM's arch information */
enum vm_state state; /* VM state */
void *vuart; /* Virtual UART */
struct acrn_vuart vuart; /* Virtual UART */
enum vpic_wire_mode wire_mode;
struct iommu_domain *iommu; /* iommu domain of this VM */
struct list_head list; /* list of VM */
@@ -243,6 +243,12 @@ static inline struct vcpu *get_primary_vcpu(struct vm *vm)
return NULL;
}
static inline struct acrn_vuart*
vm_vuart(struct vm *vm)
{
return (struct acrn_vuart *)&(vm->vuart);
}
static inline struct acrn_vpic *
vm_pic(struct vm *vm)
{

View File

@@ -22,6 +22,7 @@
#include <guest_pm.h>
#include <host_pm.h>
#include <vpic.h>
#include <vuart.h>
#include <vm.h>
#include <cpuid.h>
#include <mmu.h>