X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_console.h;h=fe84bfdcbb9f38c436565fe6169cb303780fb120;hb=0a7690f54cb5bda83780dac26ce433ad24b1d766;hp=52a7d5f6a48dc5843bbe50046acd268e62e8eb60;hpb=4731ff7dc97e42853546b38b4d441d793e7a4ec8;p=palacios-OLD.git diff --git a/palacios/include/palacios/vmm_console.h b/palacios/include/palacios/vmm_console.h index 52a7d5f..fe84bfd 100644 --- a/palacios/include/palacios/vmm_console.h +++ b/palacios/include/palacios/vmm_console.h @@ -28,63 +28,43 @@ #ifdef __V3VEE__ -#define V3_TtyOpen(vm, path, mode) \ - ({ \ - extern struct v3_console_hooks * console_hooks; \ - ((console_hooks) && (console_hooks)->tty_open) ? \ - (console_hooks)->tty_open((path), (mode), (vm)->host_priv_data) : NULL; \ - }) - -#define V3_TtyCursorSet(tty, x, y) \ - ({ \ - extern struct v3_console_hooks * console_hooks; \ - ((console_hooks) && (console_hooks)->tty_cursor_set) ? \ - (console_hooks)->tty_cursor_set((tty), (x), (y)) : -1; \ - }) - -#define V3_TtyCharacterSet(tty, x, y, c, style) \ - ({ \ - extern struct v3_console_hooks * console_hooks; \ - ((console_hooks) && (console_hooks)->tty_character_set) ? \ - (console_hooks)->tty_character_set((tty), (x), (y), (c), (style)) : -1; \ - }) - -#define V3_TtyScroll(tty, lines) \ - ({ \ - extern struct v3_console_hooks * console_hooks; \ - ((console_hooks) && (console_hooks)->tty_scroll) ? \ - (console_hooks)->tty_scroll((tty), (lines)) : -1; \ - }) - -#define V3_TtyUpdate(tty) \ - ({ \ - extern struct v3_console_hooks * console_hooks; \ - ((console_hooks) && (console_hooks)->tty_update) ? \ - (console_hooks)->tty_update((tty)) : -1; \ - }) +typedef void * v3_console_t; + +v3_console_t v3_console_open(struct v3_vm_info * vm, uint32_t width, uint32_t height); +void v3_console_close(v3_console_t cons); + +int v3_console_set_cursor(v3_console_t cons, int x, int y); +int v3_console_set_char(v3_console_t cons, int x, int y, char c, uint8_t style); +int v3_console_scroll(v3_console_t cons, int lines); +int v3_console_update(v3_console_t cons); +int v3_console_set_text_resolution(v3_console_t cons, int cols, int rows); #endif -#define TTY_OPEN_MODE_READ (1 << 0) -#define TTY_OPEN_MODE_WRITE (1 << 1) + struct v3_console_hooks { /* open console device, mode is a combination of TTY_OPEN_MODE_* flags */ - void *(*tty_open)(const char * path, int mode, void * priv_data); + void *(*open)(void * priv_data, unsigned int width, unsigned int height); + + void (*close)(void * tty); /* set cursor position */ - int (*tty_cursor_set)(void * tty, int x, int y); + int (*set_cursor)(void * tty, int x, int y); /* output character c with specified style at (x, y) */ - int (*tty_character_set)(void * tty, int x, int y, char c, unsigned char style); + int (*set_character)(void * tty, int x, int y, char c, unsigned char style); /* scroll the console down the specified number of lines */ - int (*tty_scroll)(void * tty, int lines); + int (*scroll)(void * tty, int lines); + + /* change the text resolution (always followed by a full screen update) */ + int (*set_text_resolution)(void * tty, int cols, int rows); /* force update of console display; all updates by above functions * may be defferred until the next tty_update call */ - int (*tty_update)(void * tty); + int (*update)(void * tty); };