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.


Linux printing macros for linux module
[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
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
31 #define V3_VM_MOVE_CORE 33
32
33 #define V3_VM_FB_INPUT (256+1)
34 #define V3_VM_FB_QUERY (256+2)
35
36 #define V3_VM_HOST_DEV_CONNECT (10244+1)
37
38 #define V3_VM_KSTREAM_USER_CONNECT (11244+1)
39
40 // KERN_EMERG    "<0>"  /* system is unusable               */
41 // KERN_ALERT    "<1>"  /* action must be taken immediately */
42 // KERN_CRIT     "<2>"  /* critical conditions              */
43 // KERN_ERR      "<3>"  /* error conditions                 */
44 // KERN_WARNING  "<4>"  /* warning conditions               */
45 // KERN_NOTICE   "<5>"  /* normal but significant condition */
46 // KERN_INFO     "<6>"  /* informational                    */
47 // KERN_DEBUG    "<7>"  /* debug-level messages             */
48
49 // All 'printk's should be changed to one of these macros, for easier control
50 #define ERROR(fmt, args...) printk((KERN_ERR fmt), ##args)
51 #define WARNING(fmt, args...) printk((KERN_WARNING fmt), ##args)
52 #define NOTICE(fmt, args...) printk((KERN_NOTICE fmt), ##args)
53 #define INFO(fmt, args...) printk((KERN_INFO fmt), ##args)
54 #define DEBUG(fmt, args...) printk((KERN_DEBUG fmt), ##args)
55
56 struct v3_guest_img {
57     unsigned long long size;
58     void * guest_data;
59     char name[128];
60 } __attribute__((packed));
61
62 struct v3_mem_region {
63     unsigned long long base_addr;
64     unsigned long long num_pages;
65 } __attribute__((packed));
66
67 struct v3_core_move_cmd{
68     unsigned short vcore_id;
69     unsigned short pcore_id;
70 } __attribute__((packed));
71
72 struct v3_chkpt_info {
73     char store[128];
74     char url[256]; /* This might need to be bigger... */
75 } __attribute__((packed));
76
77
78
79 void * trace_malloc(size_t size, gfp_t flags);
80 void trace_free(const void * objp);
81
82
83 struct v3_guest {
84     void * v3_ctx;
85
86     void * img; 
87     u32 img_size;
88
89     char name[128];
90
91
92     struct rb_root vm_ctrls;
93     struct list_head exts;
94
95     dev_t vm_dev; 
96     struct cdev cdev;
97 };
98
99 // For now MAX_VMS must be a multiple of 8
100 // This is due to the minor number bitmap
101 #define MAX_VMS 32
102
103
104
105 int palacios_vmm_init( void );
106 int palacios_vmm_exit( void );
107
108
109
110 #endif