[c-host] windows: update ivshmem driver header and usage

This commit is contained in:
Geoffrey McRae 2019-10-24 19:46:09 +11:00
parent e1bfb1234b
commit 1d7a2ccf82
3 changed files with 20 additions and 2 deletions

View File

@ -1 +1 @@
B1-12-g9377fdfc37+1 B1-13-ge1bfb1234b+1

View File

@ -368,11 +368,16 @@ bool os_shmemMmap(void **ptr)
return true; return true;
} }
IVSHMEM_MMAP_CONFIG config =
{
.cacheMode = IVSHMEM_CACHE_WRITECOMBINED
};
memset(&app.shmemMap, 0, sizeof(IVSHMEM_MMAP)); memset(&app.shmemMap, 0, sizeof(IVSHMEM_MMAP));
if (!DeviceIoControl( if (!DeviceIoControl(
app.shmemHandle, app.shmemHandle,
IOCTL_IVSHMEM_REQUEST_MMAP, IOCTL_IVSHMEM_REQUEST_MMAP,
NULL, 0, &config, sizeof(IVSHMEM_MMAP_CONFIG),
&app.shmemMap, sizeof(IVSHMEM_MMAP), &app.shmemMap, sizeof(IVSHMEM_MMAP),
NULL, NULL)) NULL, NULL))
{ {

View File

@ -7,6 +7,19 @@ DEFINE_GUID (GUID_DEVINTERFACE_IVSHMEM,
typedef UINT16 IVSHMEM_PEERID; typedef UINT16 IVSHMEM_PEERID;
typedef UINT64 IVSHMEM_SIZE; typedef UINT64 IVSHMEM_SIZE;
#define IVSHMEM_CACHE_NONCACHED 0
#define IVSHMEM_CACHE_CACHED 1
#define IVSHMEM_CACHE_WRITECOMBINED 2
/*
This structure is for use with the IOCTL_IVSHMEM_REQUEST_MMAP IOCTL
*/
typedef struct IVSHMEM_MMAP_CONFIG
{
UINT8 cacheMode; // the caching mode of the mapping, see IVSHMEM_CACHE_* for options
}
IVSHMEM_MMAP_CONFIG, *PIVSHMEM_MMAP_CONFIG;
/* /*
This structure is for use with the IOCTL_IVSHMEM_REQUEST_MMAP IOCTL This structure is for use with the IOCTL_IVSHMEM_REQUEST_MMAP IOCTL
*/ */