remove all trailing whitespace
This commit is contained in:
parent
d2d4966571
commit
b39f9d20a9
222 changed files with 3286 additions and 3286 deletions
|
@ -89,9 +89,9 @@ grub_console_putchar (grub_uint32_t c)
|
|||
{
|
||||
grub_efi_char16_t str[2];
|
||||
grub_efi_simple_text_output_interface_t *o;
|
||||
|
||||
|
||||
o = grub_efi_system_table->con_out;
|
||||
|
||||
|
||||
/* For now, do not try to use a surrogate pair. */
|
||||
if (c > 0xffff)
|
||||
c = '?';
|
||||
|
@ -102,7 +102,7 @@ grub_console_putchar (grub_uint32_t c)
|
|||
/* Should this test be cached? */
|
||||
if (c > 0x7f && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS)
|
||||
return;
|
||||
|
||||
|
||||
efi_call_2 (o->output_string, o, str);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ grub_console_checkkey (void)
|
|||
grub_efi_simple_input_interface_t *i;
|
||||
grub_efi_input_key_t key;
|
||||
grub_efi_status_t status;
|
||||
|
||||
|
||||
if (read_key >= 0)
|
||||
return 1;
|
||||
|
||||
|
@ -131,7 +131,7 @@ grub_console_checkkey (void)
|
|||
case GRUB_EFI_SUCCESS:
|
||||
{
|
||||
grub_uint16_t xy;
|
||||
|
||||
|
||||
xy = grub_getxy ();
|
||||
grub_gotoxy (0, 0);
|
||||
grub_printf ("scan_code=%x,unicode_char=%x ",
|
||||
|
@ -150,7 +150,7 @@ grub_console_checkkey (void)
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (status == GRUB_EFI_SUCCESS)
|
||||
{
|
||||
switch (key.scan_code)
|
||||
|
@ -229,11 +229,11 @@ grub_console_getkey (void)
|
|||
status = efi_call_3 (b->wait_for_event, 1, &(i->wait_for_key), &index);
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return -1;
|
||||
|
||||
|
||||
grub_console_checkkey ();
|
||||
}
|
||||
while (read_key < 0);
|
||||
|
||||
|
||||
key = read_key;
|
||||
read_key = -1;
|
||||
return key;
|
||||
|
@ -244,7 +244,7 @@ grub_console_getwh (void)
|
|||
{
|
||||
grub_efi_simple_text_output_interface_t *o;
|
||||
grub_efi_uintn_t columns, rows;
|
||||
|
||||
|
||||
o = grub_efi_system_table->con_out;
|
||||
if (efi_call_4 (o->query_mode, o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS)
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ static grub_uint16_t
|
|||
grub_console_getxy (void)
|
||||
{
|
||||
grub_efi_simple_text_output_interface_t *o;
|
||||
|
||||
|
||||
o = grub_efi_system_table->con_out;
|
||||
return ((o->mode->cursor_column << 8) | o->mode->cursor_row);
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ static void
|
|||
grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y)
|
||||
{
|
||||
grub_efi_simple_text_output_interface_t *o;
|
||||
|
||||
|
||||
o = grub_efi_system_table->con_out;
|
||||
efi_call_3 (o->set_cursor_position, o, x, y);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ grub_console_cls (void)
|
|||
{
|
||||
grub_efi_simple_text_output_interface_t *o;
|
||||
grub_efi_int32_t orig_attr;
|
||||
|
||||
|
||||
o = grub_efi_system_table->con_out;
|
||||
orig_attr = o->mode->attribute;
|
||||
efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK);
|
||||
|
|
|
@ -91,7 +91,7 @@ struct grub_virtual_screen
|
|||
grub_uint8_t normal_color_setting;
|
||||
grub_uint8_t highlight_color_setting;
|
||||
grub_uint8_t term_color;
|
||||
|
||||
|
||||
/* Color settings. */
|
||||
grub_video_color_t fg_color;
|
||||
grub_video_color_t bg_color;
|
||||
|
@ -117,7 +117,7 @@ static void dirty_region_reset (void);
|
|||
|
||||
static int dirty_region_is_empty (void);
|
||||
|
||||
static void dirty_region_add (int x, int y,
|
||||
static void dirty_region_add (int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
static unsigned int calculate_normal_character_width (grub_font_t font);
|
||||
|
@ -135,12 +135,12 @@ set_term_color (grub_uint8_t term_color)
|
|||
|
||||
/* Map terminal color to text layer compatible video colors. */
|
||||
virtual_screen.fg_color = grub_video_map_color(term_color & 0x0f);
|
||||
|
||||
|
||||
/* Special case: use black as transparent color. */
|
||||
if (((term_color >> 4) & 0x0f) == 0)
|
||||
{
|
||||
virtual_screen.bg_color = grub_video_map_rgba(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
virtual_screen.bg_color = grub_video_map_color((term_color >> 4) & 0x0f);
|
||||
|
@ -218,9 +218,9 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
|
|||
virtual_screen.standard_color_setting = DEFAULT_STANDARD_COLOR;
|
||||
virtual_screen.normal_color_setting = DEFAULT_NORMAL_COLOR;
|
||||
virtual_screen.highlight_color_setting = DEFAULT_HIGHLIGHT_COLOR;
|
||||
|
||||
|
||||
virtual_screen.term_color = virtual_screen.normal_color_setting;
|
||||
|
||||
|
||||
set_term_color (virtual_screen.term_color);
|
||||
|
||||
grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
|
||||
|
@ -256,7 +256,7 @@ grub_gfxterm_init (void)
|
|||
err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook);
|
||||
else
|
||||
{
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (DEFAULT_VIDEO_MODE) + 1);
|
||||
grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp, video_hook);
|
||||
|
@ -312,7 +312,7 @@ grub_gfxterm_fini (void)
|
|||
}
|
||||
|
||||
static void
|
||||
redraw_screen_rect (unsigned int x, unsigned int y,
|
||||
redraw_screen_rect (unsigned int x, unsigned int y,
|
||||
unsigned int width, unsigned int height)
|
||||
{
|
||||
grub_video_color_t color;
|
||||
|
@ -323,11 +323,11 @@ redraw_screen_rect (unsigned int x, unsigned int y,
|
|||
if (bitmap)
|
||||
{
|
||||
/* Render bitmap as background. */
|
||||
grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y,
|
||||
grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y,
|
||||
x, y,
|
||||
width, height);
|
||||
|
||||
/* If bitmap is smaller than requested blit area, use background
|
||||
|
||||
/* If bitmap is smaller than requested blit area, use background
|
||||
color. */
|
||||
color = virtual_screen.bg_color;
|
||||
|
||||
|
@ -342,27 +342,27 @@ redraw_screen_rect (unsigned int x, unsigned int y,
|
|||
{
|
||||
h = bitmap_height - y;
|
||||
}
|
||||
|
||||
|
||||
if (bitmap_width > tx)
|
||||
{
|
||||
tx = bitmap_width;
|
||||
}
|
||||
|
||||
|
||||
/* Render background layer. */
|
||||
grub_video_fill_rect (color, tx, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
/* Fill bottom side of the bitmap if needed. */
|
||||
if (y + height >= bitmap_height)
|
||||
{
|
||||
int h = (y + height) - bitmap_height;
|
||||
unsigned int ty = y;
|
||||
|
||||
|
||||
if (bitmap_height > ty)
|
||||
{
|
||||
ty = bitmap_height;
|
||||
}
|
||||
|
||||
|
||||
/* Render background layer. */
|
||||
grub_video_fill_rect (color, x, ty, width, h);
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height)
|
|||
dirty_region.top_left_y = y;
|
||||
dirty_region.bottom_right_x = x + width - 1;
|
||||
dirty_region.bottom_right_y = y + height - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x < dirty_region.top_left_x)
|
||||
|
@ -431,7 +431,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height)
|
|||
if ((y + (int)height - 1) > dirty_region.bottom_right_y)
|
||||
dirty_region.bottom_right_y = y + height - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dirty_region_add_virtualscreen (void)
|
||||
|
@ -487,10 +487,10 @@ write_char (void)
|
|||
/* Get glyph for character. */
|
||||
glyph = grub_font_get_glyph (virtual_screen.font, p->code);
|
||||
ascent = grub_font_get_ascent (virtual_screen.font);
|
||||
|
||||
|
||||
width = virtual_screen.normal_char_width * calculate_character_width(glyph);
|
||||
height = virtual_screen.normal_char_height;
|
||||
|
||||
|
||||
color = p->fg_color;
|
||||
bgcolor = p->bg_color;
|
||||
|
||||
|
@ -556,7 +556,7 @@ scroll_up (void)
|
|||
/* Redraw only changed regions. */
|
||||
dirty_region_redraw ();
|
||||
}
|
||||
|
||||
|
||||
/* Scroll text buffer with one line to up. */
|
||||
grub_memmove (virtual_screen.text_buffer,
|
||||
virtual_screen.text_buffer + virtual_screen.columns,
|
||||
|
@ -581,7 +581,7 @@ scroll_up (void)
|
|||
color = virtual_screen.bg_color;
|
||||
grub_video_scroll (color, 0, -virtual_screen.normal_char_height);
|
||||
grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
|
||||
|
||||
|
||||
/* If we have bitmap, re-draw screen, otherwise scroll physical screen too. */
|
||||
if (bitmap)
|
||||
{
|
||||
|
@ -589,7 +589,7 @@ scroll_up (void)
|
|||
dirty_region_add_virtualscreen ();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
/* Clear new border area. */
|
||||
grub_video_fill_rect (color,
|
||||
virtual_screen.offset_x, virtual_screen.offset_y,
|
||||
|
@ -825,15 +825,15 @@ grub_virtual_screen_setcolorstate (grub_term_color_state state)
|
|||
case GRUB_TERM_COLOR_STANDARD:
|
||||
virtual_screen.term_color = virtual_screen.standard_color_setting;
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_COLOR_NORMAL:
|
||||
virtual_screen.term_color = virtual_screen.normal_color_setting;
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_COLOR_HIGHLIGHT:
|
||||
virtual_screen.term_color = virtual_screen.highlight_color_setting;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -887,13 +887,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
|
|||
/* Check that we have video adapter active. */
|
||||
if (grub_video_get_info(NULL) != GRUB_ERR_NONE)
|
||||
return grub_errno;
|
||||
|
||||
|
||||
/* Destroy existing background bitmap if loaded. */
|
||||
if (bitmap)
|
||||
{
|
||||
grub_video_bitmap_destroy (bitmap);
|
||||
bitmap = 0;
|
||||
|
||||
|
||||
/* Mark whole screen as dirty. */
|
||||
dirty_region_reset ();
|
||||
dirty_region_add (0, 0, mode_info.width, mode_info.height);
|
||||
|
@ -903,7 +903,7 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (argc >= 1)
|
||||
{
|
||||
/* Try to load new one. */
|
||||
grub_video_bitmap_load (&bitmap, args[0]);
|
||||
grub_video_bitmap_load (&bitmap, args[0]);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
return grub_errno;
|
||||
|
||||
|
@ -913,13 +913,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)),
|
|||
/* Determine bitmap dimensions. */
|
||||
bitmap_width = grub_video_bitmap_get_width (bitmap);
|
||||
bitmap_height = grub_video_bitmap_get_width (bitmap);
|
||||
|
||||
|
||||
/* Mark whole screen as dirty. */
|
||||
dirty_region_reset ();
|
||||
dirty_region_add (0, 0, mode_info.width, mode_info.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* All was ok. */
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
return grub_errno;
|
||||
|
|
|
@ -127,7 +127,7 @@ serial_translate_key_sequence (void)
|
|||
{'H', 1},
|
||||
{'4', 4}
|
||||
};
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
short key;
|
||||
|
@ -148,7 +148,7 @@ serial_translate_key_sequence (void)
|
|||
if (npending >= 3)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof (three_code_table) / sizeof (three_code_table[0]);
|
||||
i++)
|
||||
|
@ -165,7 +165,7 @@ serial_translate_key_sequence (void)
|
|||
{
|
||||
unsigned int i;
|
||||
short key = *((short *) (input_buf + 2));
|
||||
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof (four_code_table) / sizeof (four_code_table[0]);
|
||||
i++)
|
||||
|
@ -187,16 +187,16 @@ fill_input_buf (const int nowait)
|
|||
for (i = 0; i < 10000 && npending < sizeof (input_buf); i++)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
||||
c = serial_hw_fetch ();
|
||||
if (c >= 0)
|
||||
{
|
||||
input_buf[npending++] = c;
|
||||
|
||||
|
||||
/* Reset the counter to zero, to wait for the same interval. */
|
||||
i = 0;
|
||||
}
|
||||
|
||||
|
||||
if (nowait)
|
||||
break;
|
||||
}
|
||||
|
@ -324,60 +324,60 @@ grub_serial_putchar (grub_uint32_t c)
|
|||
case GRUB_TERM_DISP_LEFT:
|
||||
c = '<';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_UP:
|
||||
c = '^';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_RIGHT:
|
||||
c = '>';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_DOWN:
|
||||
c = 'v';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_HLINE:
|
||||
c = '-';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_VLINE:
|
||||
c = '|';
|
||||
break;
|
||||
|
||||
|
||||
case GRUB_TERM_DISP_UL:
|
||||
case GRUB_TERM_DISP_UR:
|
||||
case GRUB_TERM_DISP_LL:
|
||||
case GRUB_TERM_DISP_LR:
|
||||
c = '+';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
c = '?';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\a':
|
||||
break;
|
||||
|
||||
|
||||
case '\b':
|
||||
case 127:
|
||||
if (xpos > 0)
|
||||
xpos--;
|
||||
break;
|
||||
|
||||
|
||||
case '\n':
|
||||
if (ypos < TEXT_HEIGHT)
|
||||
ypos++;
|
||||
break;
|
||||
|
||||
|
||||
case '\r':
|
||||
xpos = 0;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
if (xpos >= TEXT_WIDTH)
|
||||
{
|
||||
|
@ -388,7 +388,7 @@ grub_serial_putchar (grub_uint32_t c)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
serial_hw_put (c);
|
||||
}
|
||||
|
||||
|
@ -422,7 +422,7 @@ grub_serial_gotoxy (grub_uint8_t x, grub_uint8_t y)
|
|||
keep_track = 0;
|
||||
grub_terminfo_gotoxy (x, y);
|
||||
keep_track = 1;
|
||||
|
||||
|
||||
xpos = x;
|
||||
ypos = y;
|
||||
}
|
||||
|
@ -507,10 +507,10 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
if (!serial_settings.port)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad unit number.");
|
||||
}
|
||||
|
||||
|
||||
if (state[1].set)
|
||||
serial_settings.port = (unsigned short) grub_strtoul (state[1].arg, 0, 0);
|
||||
|
||||
|
||||
if (state[2].set)
|
||||
{
|
||||
unsigned long speed;
|
||||
|
@ -523,7 +523,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (state[3].set)
|
||||
{
|
||||
if (! grub_strcmp (state[3].arg, "5"))
|
||||
|
@ -540,7 +540,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad word length");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (state[4].set)
|
||||
{
|
||||
if (! grub_strcmp (state[4].arg, "no"))
|
||||
|
@ -555,7 +555,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad parity");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (state[5].set)
|
||||
{
|
||||
if (! grub_strcmp (state[5].arg, "1"))
|
||||
|
@ -571,7 +571,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
|
||||
/* Initialize with new settings. */
|
||||
hwiniterr = serial_hw_init ();
|
||||
|
||||
|
||||
if (hwiniterr == GRUB_ERR_NONE)
|
||||
{
|
||||
/* Register terminal if not yet registered. */
|
||||
|
@ -599,7 +599,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return hwiniterr;
|
||||
}
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ static void
|
|||
grub_virtual_screen_invalidate_char (struct grub_colored_char *p)
|
||||
{
|
||||
p->code = 0xFFFF;
|
||||
|
||||
|
||||
if (p->width)
|
||||
{
|
||||
struct grub_colored_char *q;
|
||||
|
@ -411,14 +411,14 @@ grub_vesafb_putchar (grub_uint32_t c)
|
|||
if (virtual_screen.cursor_x > 0)
|
||||
virtual_screen.cursor_x--;
|
||||
break;
|
||||
|
||||
|
||||
case '\n':
|
||||
if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
|
||||
scroll_up ();
|
||||
else
|
||||
virtual_screen.cursor_y++;
|
||||
break;
|
||||
|
||||
|
||||
case '\r':
|
||||
virtual_screen.cursor_x = 0;
|
||||
break;
|
||||
|
@ -431,7 +431,7 @@ grub_vesafb_putchar (grub_uint32_t c)
|
|||
{
|
||||
unsigned width;
|
||||
struct grub_colored_char *p;
|
||||
|
||||
|
||||
grub_virtual_screen_get_glyph (c, 0, &width);
|
||||
|
||||
if (virtual_screen.cursor_x + width > virtual_screen.columns)
|
||||
|
@ -457,14 +457,14 @@ grub_vesafb_putchar (grub_uint32_t c)
|
|||
p[i].index = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
write_char ();
|
||||
|
||||
|
||||
virtual_screen.cursor_x += width;
|
||||
if (virtual_screen.cursor_x >= virtual_screen.columns)
|
||||
{
|
||||
virtual_screen.cursor_x = 0;
|
||||
|
||||
|
||||
if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
|
||||
scroll_up ();
|
||||
else
|
||||
|
@ -480,7 +480,7 @@ static grub_ssize_t
|
|||
grub_vesafb_getcharwidth (grub_uint32_t c)
|
||||
{
|
||||
unsigned width;
|
||||
|
||||
|
||||
if (! grub_virtual_screen_get_glyph (c, 0, &width))
|
||||
return 0;
|
||||
|
||||
|
@ -542,7 +542,7 @@ grub_vesafb_cls (void)
|
|||
grub_virtual_screen_cls ();
|
||||
|
||||
grub_memset (framebuffer,
|
||||
0,
|
||||
0,
|
||||
mode_info.y_resolution * bytes_per_scan_line);
|
||||
}
|
||||
|
||||
|
|
|
@ -95,12 +95,12 @@ get_map_mask (void)
|
|||
{
|
||||
unsigned char old_addr;
|
||||
unsigned char old_data;
|
||||
|
||||
|
||||
old_addr = grub_inb (SEQUENCER_ADDR_PORT);
|
||||
grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT);
|
||||
|
||||
|
||||
old_data = grub_inb (SEQUENCER_DATA_PORT);
|
||||
|
||||
|
||||
grub_outb (old_addr, SEQUENCER_ADDR_PORT);
|
||||
|
||||
return old_data;
|
||||
|
@ -111,12 +111,12 @@ static void
|
|||
set_map_mask (unsigned char mask)
|
||||
{
|
||||
unsigned char old_addr;
|
||||
|
||||
|
||||
old_addr = grub_inb (SEQUENCER_ADDR_PORT);
|
||||
grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT);
|
||||
|
||||
|
||||
grub_outb (mask, SEQUENCER_DATA_PORT);
|
||||
|
||||
|
||||
grub_outb (old_addr, SEQUENCER_ADDR_PORT);
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ static void
|
|||
set_read_map (unsigned char map)
|
||||
{
|
||||
unsigned char old_addr;
|
||||
|
||||
|
||||
old_addr = grub_inb (GRAPHICS_ADDR_PORT);
|
||||
|
||||
grub_outb (READ_MAP_REGISTER, GRAPHICS_ADDR_PORT);
|
||||
|
@ -139,12 +139,12 @@ static void
|
|||
set_start_address (unsigned int start)
|
||||
{
|
||||
unsigned char old_addr;
|
||||
|
||||
|
||||
old_addr = grub_inb (CRTC_ADDR_PORT);
|
||||
|
||||
|
||||
grub_outb (START_ADDR_LOW_REGISTER, CRTC_ADDR_PORT);
|
||||
grub_outb (start & 0xFF, CRTC_DATA_PORT);
|
||||
|
||||
|
||||
grub_outb (START_ADDR_HIGH_REGISTER, CRTC_ADDR_PORT);
|
||||
grub_outb (start >> 8, CRTC_DATA_PORT);
|
||||
|
||||
|
@ -164,7 +164,7 @@ grub_vga_mod_init (void)
|
|||
font = grub_font_get (""); /* Choose any font, for now. */
|
||||
if (!font)
|
||||
return grub_error (GRUB_ERR_BAD_FONT, "No font loaded.");
|
||||
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
|
@ -192,13 +192,13 @@ write_char (void)
|
|||
unsigned char *mem_base;
|
||||
unsigned plane;
|
||||
|
||||
mem_base = (VGA_MEM + xpos +
|
||||
mem_base = (VGA_MEM + xpos +
|
||||
ypos * CHAR_HEIGHT * TEXT_WIDTH + PAGE_OFFSET (page)) - p->index;
|
||||
p -= p->index;
|
||||
|
||||
/* Get glyph for character. */
|
||||
glyph = grub_font_get_glyph (font, p->code);
|
||||
|
||||
|
||||
for (plane = 0x01; plane <= 0x08; plane <<= 1)
|
||||
{
|
||||
unsigned y;
|
||||
|
@ -219,7 +219,7 @@ write_char (void)
|
|||
for (i = 0; i < char_width && offset < 32; i++)
|
||||
{
|
||||
unsigned char fg_mask, bg_mask;
|
||||
|
||||
|
||||
fg_mask = (p->fg_color & plane) ? glyph->bitmap[offset] : 0;
|
||||
bg_mask = (p->bg_color & plane) ? ~(glyph->bitmap[offset]) : 0;
|
||||
offset++;
|
||||
|
@ -227,7 +227,7 @@ write_char (void)
|
|||
if (check_vga_mem (mem + i))
|
||||
mem[i] = (fg_mask | bg_mask);
|
||||
}
|
||||
#endif /* 0 */
|
||||
#endif /* 0 */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ write_cursor (void)
|
|||
+ (ypos * CHAR_HEIGHT + CHAR_HEIGHT - 3) * TEXT_WIDTH);
|
||||
if (check_vga_mem (mem))
|
||||
*mem = 0xff;
|
||||
|
||||
|
||||
mem += TEXT_WIDTH;
|
||||
if (check_vga_mem (mem))
|
||||
*mem = 0xff;
|
||||
|
@ -252,11 +252,11 @@ scroll_up (void)
|
|||
{
|
||||
unsigned i;
|
||||
unsigned plane;
|
||||
|
||||
|
||||
/* Do all the work in the other page. */
|
||||
grub_memmove (text_buf, text_buf + TEXT_WIDTH,
|
||||
sizeof (struct colored_char) * TEXT_WIDTH * (TEXT_HEIGHT - 1));
|
||||
|
||||
|
||||
for (i = TEXT_WIDTH * (TEXT_HEIGHT - 1); i < TEXT_WIDTH * TEXT_HEIGHT; i++)
|
||||
{
|
||||
text_buf[i].code = ' ';
|
||||
|
@ -279,7 +279,7 @@ scroll_up (void)
|
|||
grub_memset (VGA_MEM + PAGE_OFFSET (1 - page)
|
||||
+ VGA_WIDTH * (VGA_HEIGHT - CHAR_HEIGHT) / 8, 0,
|
||||
VGA_WIDTH * CHAR_HEIGHT / 8);
|
||||
|
||||
|
||||
/* Activate the other page. */
|
||||
page = 1 - page;
|
||||
wait_vretrace ();
|
||||
|
@ -292,7 +292,7 @@ grub_vga_putchar (grub_uint32_t c)
|
|||
#if DEBUG_VGA
|
||||
static int show = 1;
|
||||
#endif
|
||||
|
||||
|
||||
if (c == '\a')
|
||||
/* FIXME */
|
||||
return;
|
||||
|
@ -302,21 +302,21 @@ grub_vga_putchar (grub_uint32_t c)
|
|||
/* Erase current cursor, if any. */
|
||||
if (cursor_state)
|
||||
write_char ();
|
||||
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\b':
|
||||
if (xpos > 0)
|
||||
xpos--;
|
||||
break;
|
||||
|
||||
|
||||
case '\n':
|
||||
if (ypos >= TEXT_HEIGHT - 1)
|
||||
scroll_up ();
|
||||
else
|
||||
ypos++;
|
||||
break;
|
||||
|
||||
|
||||
case '\r':
|
||||
xpos = 0;
|
||||
break;
|
||||
|
@ -330,7 +330,7 @@ grub_vga_putchar (grub_uint32_t c)
|
|||
struct grub_font_glyph *glyph;
|
||||
struct colored_char *p;
|
||||
unsigned char_width = 1;
|
||||
|
||||
|
||||
glyph = grub_font_get_glyph(font, c);
|
||||
|
||||
if (xpos + char_width > TEXT_WIDTH)
|
||||
|
@ -354,14 +354,14 @@ grub_vga_putchar (grub_uint32_t c)
|
|||
p[i].index = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
write_char ();
|
||||
|
||||
|
||||
xpos += char_width;
|
||||
if (xpos >= TEXT_WIDTH)
|
||||
{
|
||||
xpos = 0;
|
||||
|
||||
|
||||
if (ypos >= TEXT_HEIGHT - 1)
|
||||
scroll_up ();
|
||||
else
|
||||
|
@ -391,9 +391,9 @@ grub_vga_getcharwidth (grub_uint32_t c)
|
|||
{
|
||||
#if 0
|
||||
struct grub_font_glyph glyph;
|
||||
|
||||
|
||||
glyph = grub_font_get_glyph (c);
|
||||
|
||||
|
||||
return glyph.char_width;
|
||||
#else
|
||||
(void) c; /* Prevent warning. */
|
||||
|
|
|
@ -71,7 +71,7 @@ grub_ofconsole_writeesc (const char *str)
|
|||
char chr = *(str++);
|
||||
grub_ieee1275_write (stdout_ihandle, &chr, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -158,19 +158,19 @@ grub_ofconsole_readkey (int *key)
|
|||
*key = '\e';
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (c != 91)
|
||||
return 0;
|
||||
|
||||
|
||||
grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
|
||||
if (actual <= 0)
|
||||
return 0;
|
||||
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 65:
|
||||
/* Up: Ctrl-p. */
|
||||
c = 16;
|
||||
c = 16;
|
||||
break;
|
||||
case 66:
|
||||
/* Down: Ctrl-n. */
|
||||
|
@ -186,7 +186,7 @@ grub_ofconsole_readkey (int *key)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*key = c;
|
||||
return actual > 0;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ grub_ofconsole_checkkey (void)
|
|||
{
|
||||
int key;
|
||||
int read;
|
||||
|
||||
|
||||
if (grub_buflen)
|
||||
return 1;
|
||||
|
||||
|
@ -207,7 +207,7 @@ grub_ofconsole_checkkey (void)
|
|||
grub_buflen = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ grub_ofconsole_getkey (void)
|
|||
}
|
||||
|
||||
while (! grub_ofconsole_readkey (&key));
|
||||
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ grub_terminfo_set_current (const char *str)
|
|||
grub_terminfo_free (&term.reverse_video_off);
|
||||
grub_terminfo_free (&term.cursor_on);
|
||||
grub_terminfo_free (&term.cursor_off);
|
||||
|
||||
|
||||
if (grub_strcmp ("vt100", str) == 0)
|
||||
{
|
||||
term.name = grub_strdup ("vt100");
|
||||
|
@ -102,7 +102,7 @@ grub_terminfo_set_current (const char *str)
|
|||
term.cursor_off = grub_strdup ("\e[?25l");
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminfo type.");
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ grub_usb_hid (void)
|
|||
int usb_iterate (grub_usb_device_t dev)
|
||||
{
|
||||
descdev = &dev->descdev;
|
||||
|
||||
|
||||
grub_dprintf ("usb_keyboard", "%x %x %x\n",
|
||||
descdev->class, descdev->subclass, descdev->protocol);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue