pass pointer to term to term functions

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-05-07 02:30:44 +02:00
parent 82e32bc310
commit 58664b94b7
19 changed files with 230 additions and 181 deletions

View file

@ -30,7 +30,7 @@ static const struct grub_machine_bios_data_area *bios_data_area =
#define KEYBOARD_ALT (1 << 3)
static int
grub_console_getkeystatus (void)
grub_console_getkeystatus (struct grub_term_input *term __attribute__ ((unused)))
{
grub_uint8_t status = bios_data_area->keyboard_flag_lower;
int mods = 0;

View file

@ -152,7 +152,7 @@ set_start_address (unsigned int start)
}
static grub_err_t
grub_vga_mod_init (void)
grub_vga_mod_init (struct grub_term_output *term __attribute__ ((unused)))
{
text_mode = grub_vga_set_mode (0x10);
cursor_state = 1;
@ -169,7 +169,7 @@ grub_vga_mod_init (void)
}
static grub_err_t
grub_vga_mod_fini (void)
grub_vga_mod_fini (struct grub_term_output *term __attribute__ ((unused)))
{
set_map_mask (saved_map_mask);
grub_vga_set_mode (text_mode);
@ -287,7 +287,8 @@ scroll_up (void)
}
static void
grub_vga_putchar (const struct grub_unicode_glyph *c)
grub_vga_putchar (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c)
{
#if DEBUG_VGA
static int show = 1;
@ -393,7 +394,8 @@ grub_vga_putchar (const struct grub_unicode_glyph *c)
}
static grub_ssize_t
grub_vga_getcharwidth (const struct grub_unicode_glyph *c)
grub_vga_getcharwidth (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c)
{
#if 0
struct grub_font_glyph glyph;
@ -408,19 +410,20 @@ grub_vga_getcharwidth (const struct grub_unicode_glyph *c)
}
static grub_uint16_t
grub_vga_getwh (void)
grub_vga_getwh (struct grub_term_output *term __attribute__ ((unused)))
{
return (TEXT_WIDTH << 8) | TEXT_HEIGHT;
}
static grub_uint16_t
grub_vga_getxy (void)
grub_vga_getxy (struct grub_term_output *term __attribute__ ((unused)))
{
return ((xpos << 8) | ypos);
}
static void
grub_vga_gotoxy (grub_uint8_t x, grub_uint8_t y)
grub_vga_gotoxy (struct grub_term_output *term __attribute__ ((unused)),
grub_uint8_t x, grub_uint8_t y)
{
if (x >= TEXT_WIDTH || y >= TEXT_HEIGHT)
{
@ -440,7 +443,7 @@ grub_vga_gotoxy (grub_uint8_t x, grub_uint8_t y)
}
static void
grub_vga_cls (void)
grub_vga_cls (struct grub_term_output *term __attribute__ ((unused)))
{
unsigned i;
@ -460,7 +463,8 @@ grub_vga_cls (void)
}
static void
grub_vga_setcolorstate (grub_term_color_state state)
grub_vga_setcolorstate (struct grub_term_output *term __attribute__ ((unused)),
grub_term_color_state state)
{
switch (state)
{
@ -479,7 +483,8 @@ grub_vga_setcolorstate (grub_term_color_state state)
}
static void
grub_vga_setcursor (int on)
grub_vga_setcursor (struct grub_term_output *term __attribute__ ((unused)),
int on)
{
if (cursor_state != on)
{

View file

@ -84,7 +84,8 @@ inc_x (void)
}
static void
grub_vga_text_putchar (const struct grub_unicode_glyph *c)
grub_vga_text_putchar (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c)
{
switch (c->base)
{
@ -108,13 +109,14 @@ grub_vga_text_putchar (const struct grub_unicode_glyph *c)
}
static grub_uint16_t
grub_vga_text_getxy (void)
grub_vga_text_getxy (struct grub_term_output *term __attribute__ ((unused)))
{
return (grub_curr_x << 8) | grub_curr_y;
}
static void
grub_vga_text_gotoxy (grub_uint8_t x, grub_uint8_t y)
grub_vga_text_gotoxy (struct grub_term_output *term __attribute__ ((unused)),
grub_uint8_t x, grub_uint8_t y)
{
grub_curr_x = x;
grub_curr_y = y;
@ -122,16 +124,17 @@ grub_vga_text_gotoxy (grub_uint8_t x, grub_uint8_t y)
}
static void
grub_vga_text_cls (void)
grub_vga_text_cls (struct grub_term_output *term)
{
int i;
for (i = 0; i < ROWS * COLS; i++)
((short *) VGA_TEXT_SCREEN)[i] = ' ' | (grub_console_cur_color << 8);
grub_vga_text_gotoxy (0, 0);
grub_vga_text_gotoxy (term, 0, 0);
}
static void
grub_vga_text_setcursor (int on)
grub_vga_text_setcursor (struct grub_term_output *term __attribute__ ((unused)),
int on)
{
grub_uint8_t old;
grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT);
@ -143,9 +146,9 @@ grub_vga_text_setcursor (int on)
}
static grub_err_t
grub_vga_text_init_fini (void)
grub_vga_text_init_fini (struct grub_term_output *term)
{
grub_vga_text_cls ();
grub_vga_text_cls (term);
return 0;
}