2 * V3 Control header file
13 /* Global Control IOCTLs */
14 #define V3_CREATE_GUEST 12
15 #define V3_FREE_GUEST 13
17 #define V3_ADD_MEMORY 50
18 #define V3_RESET_MEMORY 51
19 #define V3_ADD_PCI_HW_DEV 55
20 #define V3_ADD_PCI_USER_DEV 56
22 /* VM Specific IOCTLs */
24 /* VM Specific ioctls */
25 #define V3_VM_CONSOLE_CONNECT 20
26 #define V3_VM_SERIAL_CONNECT 21
27 #define V3_VM_PAUSE 23
28 #define V3_VM_CONTINUE 24
30 #define V3_VM_LAUNCH 25
34 #define V3_VM_SIMULATE 29
35 #define V3_VM_INSPECT 30
36 #define V3_VM_DEBUG 31
39 #define V3_VM_MOVE_CORE 33
42 #define V3_VM_RECEIVE 35
44 #define V3_VM_FB_INPUT 257
45 #define V3_VM_FB_QUERY 258
47 #define V3_VM_HOST_DEV_CONNECT 10245
48 #define V3_VM_KSTREAM_USER_CONNECT 11245
51 static const char * v3_dev = "/dev/v3vee";
54 unsigned long long size;
57 } __attribute__((packed));
60 struct v3_mem_region {
61 unsigned long long base_addr;
62 unsigned long long num_pages;
63 } __attribute__((packed));
66 struct v3_core_move_cmd{
67 unsigned short vcore_id;
68 unsigned short pcore_id;
69 } __attribute__((packed));
75 } __attribute__((packed));
77 struct v3_chkpt_info {
79 char url[256]; /* This might need to be bigger... */
80 unsigned long long opts;
81 #define V3_CHKPT_OPT_NONE 0
82 #define V3_CHKPT_OPT_SKIP_MEM 1 // don't write memory to store
83 #define V3_CHKPT_OPT_SKIP_DEVS 2 // don't write devices to store
84 #define V3_CHKPT_OPT_SKIP_CORES 4 // don't write core arch ind data to store
85 #define V3_CHKPT_OPT_SKIP_ARCHDEP 8 // don't write core arch dep data to store
86 } __attribute__((packed));
90 struct v3_hw_pci_dev {
95 } __attribute__((packed));
97 #define V3VEE_STR "\n\n" \
98 "The V3Vee Project (c) 2012\n" \
99 "\thttp://v3vee.org\n" \
102 #define v3_usage(fmt, args...) \
104 printf(("\nUsage: %s " fmt V3VEE_STR), argv[0], ##args); \
109 int v3_dev_ioctl (int req, void * arg);
110 int v3_vm_ioctl (const char * filename,
113 void * v3_mmap_file (const char * filename, int prot, int flags);
114 int v3_read_file (int fd, int size, unsigned char * buf);
116 int launch_vm (const char * filename);
117 int stop_vm (const char * filename);
119 unsigned long v3_hash_buffer (unsigned char * msg, unsigned int len);
121 /* XML-related structs */
130 struct xml_option * next;
140 struct mem_file_hdr {
141 unsigned int file_idx;
142 unsigned int file_size;
143 unsigned long long file_offset;
144 unsigned long file_hash;