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.


Further printing cleanup
[palacios.git] / linux_module / palacios.h
1 #ifndef _PALACIOS_H
2 #define _PALACIOS_H
3
4 #include <linux/cdev.h>
5 #include <linux/list.h>
6 #include <linux/sched.h>
7 #include <linux/slab.h>
8
9
10 /* Global Control IOCTLs */
11 #define V3_CREATE_GUEST 12
12 #define V3_FREE_GUEST 13
13
14 #define V3_ADD_MEMORY 50
15
16 /* VM Specific IOCTLs */
17 #define V3_VM_CONSOLE_CONNECT 20
18 #define V3_VM_STREAM_CONNECT 21
19
20 #define V3_VM_PAUSE 23
21 #define V3_VM_CONTINUE 24
22
23 #define V3_VM_LAUNCH 25
24 #define V3_VM_STOP 26
25 #define V3_VM_LOAD 27
26 #define V3_VM_SAVE 28
27 #define V3_VM_SIMULATE 29
28
29 #define V3_VM_INSPECT 30
30 #define V3_VM_DEBUG 31
31
32 #define V3_VM_MOVE_CORE 33
33
34 #define V3_VM_FB_INPUT 257
35 #define V3_VM_FB_QUERY 258
36
37 #define V3_VM_HOST_DEV_CONNECT 10245
38
39 #define V3_VM_KSTREAM_USER_CONNECT 11245
40
41
42 struct v3_guest_img {
43     unsigned long long size;
44     void * guest_data;
45     char name[128];
46 } __attribute__((packed));
47
48 struct v3_mem_region {
49     unsigned long long base_addr;
50     unsigned long long num_pages;
51 } __attribute__((packed));
52
53 struct v3_debug_cmd {
54     unsigned int core; 
55     unsigned int cmd;
56 } __attribute__((packed));
57
58 struct v3_core_move_cmd {
59     unsigned short vcore_id;
60     unsigned short pcore_id;
61 } __attribute__((packed));
62
63 struct v3_chkpt_info {
64     char store[128];
65     char url[256]; /* This might need to be bigger... */
66 } __attribute__((packed));
67
68
69
70
71 void * trace_malloc(size_t size, gfp_t flags);
72 void trace_free(const void * objp);
73
74
75 struct v3_guest {
76     void * v3_ctx;
77
78     void * img; 
79     u32 img_size;
80
81     char name[128];
82
83
84     struct rb_root vm_ctrls;
85     struct list_head exts;
86
87     dev_t vm_dev; 
88     struct cdev cdev;
89 };
90
91 // For now MAX_VMS must be a multiple of 8
92 // This is due to the minor number bitmap
93 #define MAX_VMS 32
94
95
96
97 int palacios_vmm_init( void );
98 int palacios_vmm_exit( void );
99
100
101 // Exported stubs, for use in other palacios components, like vnet
102 void         palacios_print(const char *fmt, ...);
103 unsigned int palacios_get_cpu(void);
104
105
106
107 // Palacios Printing Support
108
109 // These macros affect how palacios_print will generate output
110 // Turn this on for unprefaced output from palacios_print
111 #define V3_PRINTK_OLD_STYLE_OUTPUT 0
112 // Maximum length output from palacios_print
113 #define V3_PRINTK_BUF_SIZE 1024
114 // Turn this on to check if new-style output for palacios_print  contains only 7-bit chars
115 #define V3_PRINTK_CHECK_7BIT 1
116
117 //
118 // The following macros are for printing in the linux module itself, even before
119 // Palacios is initialized and after it it deinitialized
120 // All printk's in linux_module use these macros, for easier control
121 #define ERROR(fmt, args...) printk((KERN_ERR "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
122 #define WARNING(fmt, args...) printk((KERN_WARNING "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
123 #define NOTICE(fmt, args...) printk((KERN_NOTICE "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
124 #define INFO(fmt, args...) printk((KERN_INFO "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
125 #define DEBUG(fmt, args...) printk((KERN_DEBUG "palacios (pcore %u): " fmt), palacios_get_cpu(), ##args)
126
127
128 #endif