Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180309' into...
[qemu/ar7.git] / target / i386 / hax-windows.h
blob12cbd813dccf836c44af0ca01b8ba2ef711e6899
1 /*
2 * QEMU HAXM support
4 * Copyright IBM, Corp. 2008
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * Copyright (c) 2011 Intel Corporation
10 * Written by:
11 * Jiang Yunhong<yunhong.jiang@intel.com>
12 * Xin Xiaohui<xiaohui.xin@intel.com>
13 * Zhang Xiantao<xiantao.zhang@intel.com>
15 * This work is licensed under the terms of the GNU GPL, version 2 or later.
16 * See the COPYING file in the top-level directory.
20 #ifndef TARGET_I386_HAX_WINDOWS_H
21 #define TARGET_I386_HAX_WINDOWS_H
23 #include <winioctl.h>
24 #include <windef.h>
26 #define HAX_INVALID_FD INVALID_HANDLE_VALUE
28 static inline void hax_mod_close(struct hax_state *hax)
30 CloseHandle(hax->fd);
33 static inline void hax_close_fd(hax_fd fd)
35 CloseHandle(fd);
38 static inline int hax_invalid_fd(hax_fd fd)
40 return (fd == INVALID_HANDLE_VALUE);
43 #define HAX_DEVICE_TYPE 0x4000
45 #define HAX_IOCTL_VERSION CTL_CODE(HAX_DEVICE_TYPE, 0x900, \
46 METHOD_BUFFERED, FILE_ANY_ACCESS)
47 #define HAX_IOCTL_CREATE_VM CTL_CODE(HAX_DEVICE_TYPE, 0x901, \
48 METHOD_BUFFERED, FILE_ANY_ACCESS)
49 #define HAX_IOCTL_CAPABILITY CTL_CODE(HAX_DEVICE_TYPE, 0x910, \
50 METHOD_BUFFERED, FILE_ANY_ACCESS)
52 #define HAX_VM_IOCTL_VCPU_CREATE CTL_CODE(HAX_DEVICE_TYPE, 0x902, \
53 METHOD_BUFFERED, FILE_ANY_ACCESS)
54 #define HAX_VM_IOCTL_ALLOC_RAM CTL_CODE(HAX_DEVICE_TYPE, 0x903, \
55 METHOD_BUFFERED, FILE_ANY_ACCESS)
56 #define HAX_VM_IOCTL_SET_RAM CTL_CODE(HAX_DEVICE_TYPE, 0x904, \
57 METHOD_BUFFERED, FILE_ANY_ACCESS)
58 #define HAX_VM_IOCTL_VCPU_DESTROY CTL_CODE(HAX_DEVICE_TYPE, 0x905, \
59 METHOD_BUFFERED, FILE_ANY_ACCESS)
60 #define HAX_VM_IOCTL_ADD_RAMBLOCK CTL_CODE(HAX_DEVICE_TYPE, 0x913, \
61 METHOD_BUFFERED, FILE_ANY_ACCESS)
63 #define HAX_VCPU_IOCTL_RUN CTL_CODE(HAX_DEVICE_TYPE, 0x906, \
64 METHOD_BUFFERED, FILE_ANY_ACCESS)
65 #define HAX_VCPU_IOCTL_SET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x907, \
66 METHOD_BUFFERED, FILE_ANY_ACCESS)
67 #define HAX_VCPU_IOCTL_GET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x908, \
68 METHOD_BUFFERED, FILE_ANY_ACCESS)
69 #define HAX_VCPU_IOCTL_SET_FPU CTL_CODE(HAX_DEVICE_TYPE, 0x909, \
70 METHOD_BUFFERED, FILE_ANY_ACCESS)
71 #define HAX_VCPU_IOCTL_GET_FPU CTL_CODE(HAX_DEVICE_TYPE, 0x90a, \
72 METHOD_BUFFERED, FILE_ANY_ACCESS)
74 #define HAX_VCPU_IOCTL_SETUP_TUNNEL CTL_CODE(HAX_DEVICE_TYPE, 0x90b, \
75 METHOD_BUFFERED, FILE_ANY_ACCESS)
76 #define HAX_VCPU_IOCTL_INTERRUPT CTL_CODE(HAX_DEVICE_TYPE, 0x90c, \
77 METHOD_BUFFERED, FILE_ANY_ACCESS)
78 #define HAX_VCPU_SET_REGS CTL_CODE(HAX_DEVICE_TYPE, 0x90d, \
79 METHOD_BUFFERED, FILE_ANY_ACCESS)
80 #define HAX_VCPU_GET_REGS CTL_CODE(HAX_DEVICE_TYPE, 0x90e, \
81 METHOD_BUFFERED, FILE_ANY_ACCESS)
83 #define HAX_VM_IOCTL_NOTIFY_QEMU_VERSION CTL_CODE(HAX_DEVICE_TYPE, 0x910, \
84 METHOD_BUFFERED, \
85 FILE_ANY_ACCESS)
86 #endif /* TARGET_I386_HAX_WINDOWS_H */