Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Assorted cleanup
[palacios.git] / linux_usr / v3_ctrl.h
1 /* 
2  * V3 Control header file 
3  * (c) Jack lange, 2010
4  */
5
6 #ifndef _v3_ctrl_h
7 #define _v3_ctrl_h
8
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "ezxml.h"
12
13 /* Global Control IOCTLs */
14 #define V3_CREATE_GUEST 12
15 #define V3_FREE_GUEST 13
16
17 #define V3_ADD_MEMORY 50
18 #define V3_RESET_MEMORY 51
19 #define V3_REMOVE_MEMORY 52
20
21 #define V3_ADD_PCI_HW_DEV 55
22 #define V3_ADD_PCI_USER_DEV 56
23
24 /* VM Specific IOCTLs */
25
26 /* VM Specific ioctls */
27 #define V3_VM_CONSOLE_CONNECT 20
28 #define V3_VM_SERIAL_CONNECT 21
29 #define V3_VM_PAUSE 23
30 #define V3_VM_CONTINUE 24
31
32 #define V3_VM_LAUNCH 25
33 #define V3_VM_STOP 26
34 #define V3_VM_LOAD 27
35 #define V3_VM_SAVE 28
36 #define V3_VM_SIMULATE 29
37 #define V3_VM_INSPECT 30
38 #define V3_VM_DEBUG 31
39
40
41 #define V3_VM_MOVE_CORE 33
42
43 #define V3_VM_SEND    34
44 #define V3_VM_RECEIVE 35
45
46 #define V3_VM_FB_INPUT 257
47 #define V3_VM_FB_QUERY 258
48
49 #define V3_VM_HOST_DEV_CONNECT 10245
50 #define V3_VM_KSTREAM_USER_CONNECT 11245
51
52
53 static const char * v3_dev = "/dev/v3vee";
54
55 struct v3_guest_img {
56     unsigned long long size;
57     void * guest_data;
58     char name[128];
59 } __attribute__((packed));
60
61
62 typedef enum { PREALLOCATED=0,          // user space-allocated (e.g. hot remove)
63                REQUESTED,               // kernel will attempt allocation (anywhere)
64                REQUESTED32,             // kernel will attempt allocation (<4GB)
65 } v3_mem_region_type_t;
66
67 struct v3_mem_region {
68     v3_mem_region_type_t type;         // 
69     int                  node;         // numa node for REQUESTED (-1 = any)
70     unsigned long long   base_addr;    // region start (hpa) for PREALLOCATED
71     unsigned long long   num_pages;    // size for PREALLOCATED or request size for REQUESTED
72                                        // should be power of 2 and > V3_CONFIG_MEM_BLOCK
73 } __attribute__((packed));
74
75
76 struct v3_core_move_cmd{
77     unsigned short vcore_id;
78     unsigned short pcore_id;
79 } __attribute__((packed));
80
81 struct v3_debug_cmd {
82     unsigned int core; 
83     unsigned int cmd;
84 } __attribute__((packed));
85
86 struct v3_chkpt_info {
87     char store[128];
88     char url[256]; /* This might need to be bigger... */
89     unsigned long long opts;
90 #define V3_CHKPT_OPT_NONE         0
91 #define V3_CHKPT_OPT_SKIP_MEM     1  // don't write memory to store
92 #define V3_CHKPT_OPT_SKIP_DEVS    2  // don't write devices to store
93 #define V3_CHKPT_OPT_SKIP_CORES   4  // don't write core arch ind data to store
94 #define V3_CHKPT_OPT_SKIP_ARCHDEP 8  // don't write core arch dep data to store
95 } __attribute__((packed));
96
97
98
99 struct v3_hw_pci_dev {
100     char url[128];
101     unsigned int bus;
102     unsigned int dev;
103     unsigned int func;
104 } __attribute__((packed));
105
106 #define V3VEE_STR "\n\n"                         \
107                   "The V3Vee Project (c) 2012\n" \
108                   "\thttp://v3vee.org\n"         \
109                   "\n\n"
110                    
111 #define v3_usage(fmt, args...)                                \
112 {                                                             \
113     printf(("\nUsage: %s " fmt V3VEE_STR), argv[0], ##args);  \
114     exit(0);                                                  \
115 }
116
117
118 int v3_dev_ioctl (int req, void * arg);
119 int v3_vm_ioctl  (const char * filename,
120                   int req,
121                   void * arg);
122 void * v3_mmap_file (const char * filename, int prot, int flags);
123 int v3_read_file (int fd, int size, unsigned char * buf);
124
125 int launch_vm (const char * filename);
126 int stop_vm   (const char * filename);
127
128 unsigned long v3_hash_buffer (unsigned char * msg, unsigned int len);
129
130 /* XML-related structs */
131 struct cfg_value {
132     char * tag;
133     char * value;
134 };
135
136 struct xml_option {
137     char * tag;
138     ezxml_t location;
139     struct xml_option * next;
140 };
141
142
143 struct file_info {
144     int size;
145     char filename[2048];
146     char id[256];
147 };
148
149 struct mem_file_hdr {
150     unsigned int file_idx;
151     unsigned int file_size;
152     unsigned long long file_offset;
153     unsigned long file_hash;
154 };
155
156
157 #endif