ui: avoid risk of 32-bit int overflow in VNC buffer check
[qemu/ar7.git] / target / i386 / hax-windows.h
blob20e2f85407b916f5f22053821d79fe1d1b538987
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)
61 #define HAX_VCPU_IOCTL_RUN CTL_CODE(HAX_DEVICE_TYPE, 0x906, \
62 METHOD_BUFFERED, FILE_ANY_ACCESS)
63 #define HAX_VCPU_IOCTL_SET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x907, \
64 METHOD_BUFFERED, FILE_ANY_ACCESS)
65 #define HAX_VCPU_IOCTL_GET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x908, \
66 METHOD_BUFFERED, FILE_ANY_ACCESS)
67 #define HAX_VCPU_IOCTL_SET_FPU CTL_CODE(HAX_DEVICE_TYPE, 0x909, \
68 METHOD_BUFFERED, FILE_ANY_ACCESS)
69 #define HAX_VCPU_IOCTL_GET_FPU CTL_CODE(HAX_DEVICE_TYPE, 0x90a, \
70 METHOD_BUFFERED, FILE_ANY_ACCESS)
72 #define HAX_VCPU_IOCTL_SETUP_TUNNEL CTL_CODE(HAX_DEVICE_TYPE, 0x90b, \
73 METHOD_BUFFERED, FILE_ANY_ACCESS)
74 #define HAX_VCPU_IOCTL_INTERRUPT CTL_CODE(HAX_DEVICE_TYPE, 0x90c, \
75 METHOD_BUFFERED, FILE_ANY_ACCESS)
76 #define HAX_VCPU_SET_REGS CTL_CODE(HAX_DEVICE_TYPE, 0x90d, \
77 METHOD_BUFFERED, FILE_ANY_ACCESS)
78 #define HAX_VCPU_GET_REGS CTL_CODE(HAX_DEVICE_TYPE, 0x90e, \
79 METHOD_BUFFERED, FILE_ANY_ACCESS)
81 #define HAX_VM_IOCTL_NOTIFY_QEMU_VERSION CTL_CODE(HAX_DEVICE_TYPE, 0x910, \
82 METHOD_BUFFERED, \
83 FILE_ANY_ACCESS)
84 #endif /* TARGET_I386_HAX_WINDOWS_H */