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.


clear instruction to 0 before decoding with xed
[palacios.git] / palacios / src / interfaces / vmm_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) 2010, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2010, Erik van der Kouwe <vdkouwe@cs.vu.nl> 
12  * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
13  * All rights reserved.
14  *
15  * Author: Jack Lange <jarusl@cs.northwestern.edu>
16  * Author: Erik van der Kouwe <vdkouwe@cs.vu.nl> 
17  *
18  * This is free software.  You are permitted to use,
19  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20  */
21
22
23 #include <interfaces/vmm_console.h>
24 #include <palacios/vmm.h>
25 #include <palacios/vmm_debug.h>
26 #include <palacios/vmm_types.h>
27 #include <palacios/vm_guest.h>
28
29 struct v3_console_hooks * console_hooks = 0;
30
31 v3_console_t v3_console_open(struct v3_vm_info * vm, uint32_t width, uint32_t height) {
32     V3_ASSERT(console_hooks != NULL);
33     V3_ASSERT(console_hooks->open != NULL);
34
35     return console_hooks->open(vm->host_priv_data, width, height);
36 }
37
38 void v3_console_close(v3_console_t cons) {
39     V3_ASSERT(console_hooks);
40     V3_ASSERT(console_hooks->close);
41
42     console_hooks->close(cons);
43 }
44
45 int v3_console_set_cursor(v3_console_t cons, int x, int y) {
46     V3_ASSERT(console_hooks != NULL);
47     V3_ASSERT(console_hooks->set_cursor != NULL);
48
49     return console_hooks->set_cursor(cons, x, y);
50 }
51
52 int v3_console_set_char(v3_console_t cons, int x, int y, char c, uint8_t style) {
53     V3_ASSERT(console_hooks != NULL);
54     V3_ASSERT(console_hooks->set_character != NULL);
55
56     return console_hooks->set_character(cons, x, y, c, style);    
57 }
58
59     
60 int v3_console_scroll(v3_console_t cons, int lines) {
61     V3_ASSERT(console_hooks != NULL);
62     V3_ASSERT(console_hooks->scroll != NULL);
63     
64     return console_hooks->scroll(cons, lines);
65 }
66
67 int v3_console_set_text_resolution(v3_console_t cons, int cols, int rows) {
68     V3_ASSERT(console_hooks != NULL);
69     V3_ASSERT(console_hooks->set_text_resolution != NULL);
70     
71     return console_hooks->set_text_resolution(cons, cols, rows);
72 }
73
74 int v3_console_update(v3_console_t cons) {
75     V3_ASSERT(console_hooks != NULL);
76     V3_ASSERT(console_hooks->update != NULL);
77     
78     return console_hooks->update(cons);
79 }
80
81 void V3_Init_Console(struct v3_console_hooks * hooks) {
82     console_hooks = hooks;
83     PrintDebug("V3 console inited\n");
84
85     return;
86 }