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.


moved CONSOLE host event to SERIAL host event
[palacios.git] / palacios / include / palacios / vmm_host_events.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VMM_HOST_EVENTS_H__
21 #define __VMM_HOST_EVENTS_H__
22
23
24 struct v3_keyboard_event {
25     unsigned char status;
26     unsigned char scan_code;
27 };
28
29 struct v3_mouse_event {
30     unsigned char data[3];
31 };
32
33 struct v3_timer_event {
34     unsigned int period_us;
35 };
36
37 struct v3_serial_event {
38     unsigned char data[128];
39     unsigned int len;
40 };
41
42 struct v3_console_event {
43     unsigned int cmd;
44 };
45
46 #ifdef __V3VEE__
47
48 #include <palacios/vmm_list.h>
49
50 struct v3_vm_info;
51
52 typedef enum { HOST_KEYBOARD_EVT, 
53                HOST_MOUSE_EVT, 
54                HOST_TIMER_EVT,
55                HOST_CONSOLE_EVT,
56                HOST_SERIAL_EVT } v3_host_evt_type_t;
57
58
59 union v3_host_event_handler {
60     int (*keyboard_handler)(struct v3_vm_info * vm, struct v3_keyboard_event * evt, void * priv_data);
61     int (*mouse_handler)(struct v3_vm_info * vm, struct v3_mouse_event * evt, void * priv_data);
62     int (*timer_handler)(struct v3_vm_info * vm, struct v3_timer_event * evt, void * priv_data);
63     int (*serial_handler)(struct v3_vm_info * vm, struct v3_serial_event * evt, void * priv_data);
64     int (*console_handler)(struct v3_vm_info * vm, struct v3_console_event * evt, void * priv_data);
65 };
66
67
68 struct v3_host_event_hook {
69     union v3_host_event_handler cb;
70     void * private_data;
71     struct list_head link;
72 };
73
74
75
76 struct v3_host_events {
77     struct list_head keyboard_events;
78     struct list_head mouse_events;
79     struct list_head timer_events;
80     struct list_head serial_events;
81     struct list_head console_events;
82 };
83
84
85
86 int v3_init_host_events(struct v3_vm_info * vm);
87
88 #define V3_HOST_EVENT_HANDLER(cb) ((union v3_host_event_handler)cb)
89
90 int v3_hook_host_event(struct v3_vm_info * vm, 
91                        v3_host_evt_type_t event_type, 
92                        union v3_host_event_handler cb, 
93                        void * private_data);
94
95 #endif /* ! __V3VEE__ */
96
97
98
99 int v3_deliver_keyboard_event(struct v3_vm_info * vm, struct v3_keyboard_event * evt);
100 int v3_deliver_mouse_event(struct v3_vm_info * vm, struct v3_mouse_event * evt);
101 int v3_deliver_timer_event(struct v3_vm_info * vm, struct v3_timer_event * evt);
102 int v3_deliver_serial_event(struct v3_vm_info * vm, struct v3_serial_event * evt);
103 int v3_deliver_console_event(struct v3_vm_info * vm, struct v3_console_event * evt);
104
105
106
107 #endif