From 1d7a2ccf82fe3e51e369fdabed38b3a01ac7a725 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 24 Oct 2019 19:46:09 +1100 Subject: [PATCH] [c-host] windows: update ivshmem driver header and usage --- VERSION | 2 +- c-host/platform/Windows/src/platform.c | 7 ++++++- vendor/ivshmem/ivshmem.h | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 05aa7aac..0ad3e648 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-12-g9377fdfc37+1 \ No newline at end of file +B1-13-ge1bfb1234b+1 \ No newline at end of file diff --git a/c-host/platform/Windows/src/platform.c b/c-host/platform/Windows/src/platform.c index 51768527..0a0e20fc 100644 --- a/c-host/platform/Windows/src/platform.c +++ b/c-host/platform/Windows/src/platform.c @@ -368,11 +368,16 @@ bool os_shmemMmap(void **ptr) return true; } + IVSHMEM_MMAP_CONFIG config = + { + .cacheMode = IVSHMEM_CACHE_WRITECOMBINED + }; + memset(&app.shmemMap, 0, sizeof(IVSHMEM_MMAP)); if (!DeviceIoControl( app.shmemHandle, IOCTL_IVSHMEM_REQUEST_MMAP, - NULL, 0, + &config, sizeof(IVSHMEM_MMAP_CONFIG), &app.shmemMap, sizeof(IVSHMEM_MMAP), NULL, NULL)) { diff --git a/vendor/ivshmem/ivshmem.h b/vendor/ivshmem/ivshmem.h index 20105ff5..3f98491e 100644 --- a/vendor/ivshmem/ivshmem.h +++ b/vendor/ivshmem/ivshmem.h @@ -7,6 +7,19 @@ DEFINE_GUID (GUID_DEVINTERFACE_IVSHMEM, typedef UINT16 IVSHMEM_PEERID; 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 */