mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
hv: implement ivshmem memory regions initialization
The ivshmem memory regions use the memory of the hypervisor and they are continuous and page aligned. this patch is used to initialize each memory region hpa. v2: 1) if CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED is not defined, the entire code of ivshmem will not be compiled. 2) change ivshmem shared memory unit from byte to page to avoid misconfiguration. 3) add ivshmem configuration and vm configuration references v3: 1) change CONFIG_IVSHMEM_SHARED_MEMORY_ENABLED to CONFIG_IVSHMEM_ENABLED 2) remove the ivshmem configuration sample, offline tool provides default ivshmem configuration. 3) refine code style. v4: 1) make ivshmem_base 2M aligned. Tracked-On: #4853 Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
28
hypervisor/include/dm/ivshmem.h
Normal file
28
hypervisor/include/dm/ivshmem.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef IVSHMEM_H
|
||||
#define IVSHMEM_H
|
||||
|
||||
#ifdef CONFIG_IVSHMEM_ENABLED
|
||||
struct ivshmem_shm_region {
|
||||
char name[32];
|
||||
uint64_t hpa;
|
||||
uint64_t size;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize ivshmem shared memory regions
|
||||
*
|
||||
* Initialize ivshmem shared memory regions based on user configuration.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void init_ivshmem_shared_memory(void);
|
||||
|
||||
#endif /* CONFIG_IVSHMEM_ENABLED */
|
||||
|
||||
#endif /* IVSHMEM_H */
|
Reference in New Issue
Block a user