From 026bdb00f2c872cfe3a9a250709cd72420b69e51 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 28 May 2019 14:51:47 +1000 Subject: [PATCH] [c-host] take just the ivshmem headers and omit the kvm-guest submodule --- .gitmodules | 3 -- VERSION | 2 +- c-host/CMakeLists.txt | 2 +- c-host/platform/Windows/src/platform.c | 2 +- vendor/ivshmem/ivshmem.h | 56 ++++++++++++++++++++++++++ vendor/kvm-guest-drivers-windows | 1 - 6 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 vendor/ivshmem/ivshmem.h delete mode 160000 vendor/kvm-guest-drivers-windows diff --git a/.gitmodules b/.gitmodules index b63750f8..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "vendor/kvm-guest-drivers-windows"] - path = vendor/kvm-guest-drivers-windows - url = https://github.com/virtio-win/kvm-guest-drivers-windows.git diff --git a/VERSION b/VERSION index 6b36f1dc..6e2c22d4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-rc3-7-g7d26027752+1 \ No newline at end of file +B1-rc3-8-g373d4ac932+1 \ No newline at end of file diff --git a/c-host/CMakeLists.txt b/c-host/CMakeLists.txt index 007e6ab3..46f64de6 100644 --- a/c-host/CMakeLists.txt +++ b/c-host/CMakeLists.txt @@ -38,7 +38,7 @@ get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) include_directories( ${PROJECT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include - ${PROJECT_TOP}/vendor/kvm-guest-drivers-windows + ${PROJECT_TOP}/vendor/ivshmem ${PKGCONFIG_INCLUDE_DIRS} ${GMP_INCLUDE_DIR} ) diff --git a/c-host/platform/Windows/src/platform.c b/c-host/platform/Windows/src/platform.c index 9565e644..253c70ae 100644 --- a/c-host/platform/Windows/src/platform.c +++ b/c-host/platform/Windows/src/platform.c @@ -29,7 +29,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include "common/debug.h" #include "common/option.h" #include "windows/debug.h" -#include "ivshmem/Public.h" +#include "ivshmem.h" #define ID_MENU_OPEN_LOG 3000 #define ID_MENU_EXIT 3001 diff --git a/vendor/ivshmem/ivshmem.h b/vendor/ivshmem/ivshmem.h new file mode 100644 index 00000000..20105ff5 --- /dev/null +++ b/vendor/ivshmem/ivshmem.h @@ -0,0 +1,56 @@ +#include + +DEFINE_GUID (GUID_DEVINTERFACE_IVSHMEM, + 0xdf576976,0x569d,0x4672,0x95,0xa0,0xf5,0x7e,0x4e,0xa0,0xb2,0x10); +// {df576976-569d-4672-95a0-f57e4ea0b210} + +typedef UINT16 IVSHMEM_PEERID; +typedef UINT64 IVSHMEM_SIZE; + +/* + This structure is for use with the IOCTL_IVSHMEM_REQUEST_MMAP IOCTL +*/ +typedef struct IVSHMEM_MMAP +{ + IVSHMEM_PEERID peerID; // our peer id + IVSHMEM_SIZE size; // the size of the memory region + PVOID ptr; // pointer to the memory region + UINT16 vectors; // the number of vectors available +} +IVSHMEM_MMAP, *PIVSHMEM_MMAP; + +/* + This structure is for use with the IOCTL_IVSHMEM_RING_DOORBELL IOCTL +*/ +typedef struct IVSHMEM_RING +{ + IVSHMEM_PEERID peerID; // the id of the peer to ring + UINT16 vector; // the doorbell to ring +} +IVSHMEM_RING, *PIVSHMEM_RING; + +/* + This structure is for use with the IOCTL_IVSHMEM_REGISTER_EVENT IOCTL + + Please Note: + - The IVSHMEM driver has a hard limit of 32 events. + - Events that are singleShot are released after they have been set. + - At this time repeating events are only released when the driver device + handle is closed, closing the event handle doesn't release it from the + drivers list. While this won't cause a problem in the driver, it will + cause you to run out of event slots. + */ +typedef struct IVSHMEM_EVENT +{ + UINT16 vector; // the vector that triggers the event + HANDLE event; // the event to trigger + BOOLEAN singleShot; // set to TRUE if you want the driver to only trigger this event once +} +IVSHMEM_EVENT, *PIVSHMEM_EVENT; + +#define IOCTL_IVSHMEM_REQUEST_PEERID CTL_CODE(FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IVSHMEM_REQUEST_SIZE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IVSHMEM_REQUEST_MMAP CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IVSHMEM_RELEASE_MMAP CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IVSHMEM_RING_DOORBELL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IVSHMEM_REGISTER_EVENT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS) diff --git a/vendor/kvm-guest-drivers-windows b/vendor/kvm-guest-drivers-windows deleted file mode 160000 index 8c097560..00000000 --- a/vendor/kvm-guest-drivers-windows +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8c097560f81eb9646dcf2a1b646744e6a8dbbfe7