#ifdef __V3VEE__
-#define V3_TtyOpen(path, mode) \
+#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)) : NULL; \
+ 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; \
+ 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) ? \
+ 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) ? \
+ 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; \
+ extern struct v3_console_hooks * console_hooks; \
+ ((console_hooks) && (console_hooks)->tty_update) ? \
+ (console_hooks)->tty_update((tty)) : -1; \
})
#endif
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 *(*tty_open)(const char * path, int mode, void * priv_data);
/* set cursor position */
- int (*tty_cursor_set)(void *tty, int x, int y);
+ int (*tty_cursor_set)(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 (*tty_character_set)(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 (*tty_scroll)(void * tty, int lines);
/* 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 (*tty_update)(void * tty);
};