From 38e29037707d825c5a0684ff53af341b6be2c0dc Mon Sep 17 00:00:00 2001 From: Yuan Liu Date: Thu, 10 Sep 2020 12:14:19 +0800 Subject: [PATCH] hv: move mem_regions to ivshmem.c This is a bug fix that avoids multiple declarations of mem_regions Tracked-On: #4853 Signed-off-by: Yuan Liu Acked-by: Eddie Dong --- hypervisor/dm/vpci/ivshmem.c | 4 ++++ .../scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hypervisor/dm/vpci/ivshmem.c b/hypervisor/dm/vpci/ivshmem.c index be22e77e3..6d8910699 100644 --- a/hypervisor/dm/vpci/ivshmem.c +++ b/hypervisor/dm/vpci/ivshmem.c @@ -28,6 +28,10 @@ #define IVSHMEM_IV_POS_REG 0x8U #define IVSHMEM_DOORBELL_REG 0xcU +static struct ivshmem_shm_region mem_regions[8] = { + IVSHMEM_SHM_REGIONS +}; + struct ivshmem_device { struct pci_vdev* pcidev; union { diff --git a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h index 3a91f92ff..734c8801c 100644 --- a/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h +++ b/misc/vm_configs/scenarios/hybrid_rt/whl-ipc-i5/ivshmem_cfg.h @@ -19,11 +19,10 @@ /* All user defined memory regions */ -struct ivshmem_shm_region mem_regions[] = { - { - .name = IVSHMEM_SHM_REGION_0, - .size = 0x200000UL, /* 2M */ +#define IVSHMEM_SHM_REGIONS \ + { \ + .name = IVSHMEM_SHM_REGION_0,\ + .size = 0x200000UL, /* 2MB */\ }, -}; #endif /* IVSHMEM_CFG_H */