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.


3857f659c9f72ca97c4d719e315ae0dd083cda25
[palacios.git] / palacios / src / interfaces / vmm_graphics_console.c
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) 2011, Peter Dinda <pdinda@northwestern.edu>
11  * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Peter Dinda <pdinda@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
21 #include <interfaces/vmm_graphics_console.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vmm_debug.h>
24 #include <palacios/vmm_types.h>
25 #include <palacios/vm_guest.h>
26
27 struct v3_graphics_console_hooks * graphics_console_hooks = 0;
28
29 v3_graphics_console_t v3_graphics_console_open(struct v3_vm_info * vm, 
30                                                struct v3_frame_buffer_spec *desired_spec,
31                                                struct v3_frame_buffer_spec *actual_spec)
32 {                                              
33     V3_ASSERT(graphics_console_hooks != NULL);
34     V3_ASSERT(graphics_console_hooks->open != NULL);
35
36     return graphics_console_hooks->open(vm->host_priv_data, desired_spec, actual_spec);
37 }
38
39 void v3_graphics_console_close(v3_graphics_console_t cons) 
40 {
41     V3_ASSERT(graphics_console_hooks);
42     V3_ASSERT(graphics_console_hooks->close);
43
44     graphics_console_hooks->close(cons);
45 }
46
47 void * v3_graphics_console_get_frame_buffer_data_read(v3_graphics_console_t cons, struct v3_frame_buffer_spec *spec) 
48 {
49     V3_ASSERT(graphics_console_hooks != NULL);
50     V3_ASSERT(graphics_console_hooks->get_data_read != NULL);
51     
52     return graphics_console_hooks->get_data_read(cons, spec);
53 }
54
55
56 void  v3_graphics_console_release_frame_buffer_data_read(v3_graphics_console_t cons)
57 {
58     V3_ASSERT(graphics_console_hooks != NULL);
59     V3_ASSERT(graphics_console_hooks->release_data_read != NULL);
60     
61     return graphics_console_hooks->release_data_read(cons);
62 }
63
64 void * v3_graphics_console_get_frame_buffer_data_rw(v3_graphics_console_t cons, struct v3_frame_buffer_spec *spec) 
65 {
66     V3_ASSERT(graphics_console_hooks != NULL);
67     V3_ASSERT(graphics_console_hooks->get_data_rw != NULL);
68     
69     return graphics_console_hooks->get_data_rw(cons, spec);
70 }
71
72 void v3_graphics_console_release_frame_buffer_data_rw(v3_graphics_console_t cons)
73 {
74     V3_ASSERT(graphics_console_hooks != NULL);
75     V3_ASSERT(graphics_console_hooks->release_data_rw != NULL);
76     
77     return graphics_console_hooks->release_data_rw(cons);
78 }
79
80
81
82 int v3_graphics_console_inform_update(v3_graphics_console_t cons) {
83     V3_ASSERT(graphics_console_hooks != NULL);
84     V3_ASSERT(graphics_console_hooks->changed != NULL);
85     
86     return graphics_console_hooks->changed(cons);
87 }
88
89 int   v3_graphics_console_register_render_request(
90                       v3_graphics_console_t cons,
91                       int (*render_request)(v3_graphics_console_t cons,
92                                             void *priv_data),
93                       void *priv_data)
94 {
95   V3_ASSERT(graphics_console_hooks!=NULL);
96   V3_ASSERT(graphics_console_hooks->register_render_request!=NULL);
97   
98   return graphics_console_hooks->register_render_request(cons,render_request,priv_data);
99 }
100
101 int   v3_graphics_console_register_update_inquire(
102                       v3_graphics_console_t cons,
103                       int (*update_inquire)(v3_graphics_console_t cons,
104                                             void *priv_data),
105                       void *priv_data)
106 {
107   V3_ASSERT(graphics_console_hooks!=NULL);
108   V3_ASSERT(graphics_console_hooks->register_update_inquire!=NULL);
109   
110   return graphics_console_hooks->register_update_inquire(cons,update_inquire,priv_data);
111 }
112
113
114 void V3_Init_Graphics_Console(struct v3_graphics_console_hooks * hooks) {
115     graphics_console_hooks = hooks;
116     PrintDebug("V3 graphics console inited\n");
117
118     return;
119 }