merge mainline into net

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-10-25 13:19:10 +02:00
commit dc5aeea5b9
103 changed files with 2530 additions and 690 deletions

View file

@ -24,10 +24,6 @@
#include <grub/efi/api.h>
#include <grub/efi/console.h>
static const grub_uint8_t
grub_console_standard_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_YELLOW,
GRUB_EFI_BACKGROUND_BLACK);
static grub_uint32_t
map_char (grub_uint32_t c)
{
@ -208,13 +204,14 @@ grub_console_setcolorstate (struct grub_term_output *term,
switch (state) {
case GRUB_TERM_COLOR_STANDARD:
efi_call_2 (o->set_attributes, o, grub_console_standard_color);
efi_call_2 (o->set_attributes, o, GRUB_TERM_DEFAULT_STANDARD_COLOR
& 0x7f);
break;
case GRUB_TERM_COLOR_NORMAL:
efi_call_2 (o->set_attributes, o, term->normal_color);
efi_call_2 (o->set_attributes, o, term->normal_color & 0x7f);
break;
case GRUB_TERM_COLOR_HIGHLIGHT:
efi_call_2 (o->set_attributes, o, term->highlight_color);
efi_call_2 (o->set_attributes, o, term->highlight_color & 0x7f);
break;
default:
break;
@ -266,10 +263,8 @@ static struct grub_term_output grub_console_term_output =
.cls = grub_console_cls,
.setcolorstate = grub_console_setcolorstate,
.setcursor = grub_console_setcursor,
.normal_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_LIGHTGRAY,
GRUB_EFI_BACKGROUND_BLACK),
.highlight_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_BLACK,
GRUB_EFI_BACKGROUND_LIGHTGRAY),
.normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
.highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
.flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS
};

View file

@ -90,7 +90,7 @@ grub_ofconsole_dimensions (void)
if (! grub_ieee1275_get_property (options, "screen-#columns",
val, lval, 0))
grub_ofconsole_terminfo_output->width
grub_ofconsole_terminfo_output.width
= (grub_uint8_t) grub_strtoul (val, 0, 10);
}
if (! grub_ieee1275_get_property_length (options, "screen-#rows", &lval)
@ -99,16 +99,16 @@ grub_ofconsole_dimensions (void)
char val[lval];
if (! grub_ieee1275_get_property (options, "screen-#rows",
val, lval, 0))
grub_ofconsole_terminfo_output->height
grub_ofconsole_terminfo_output.height
= (grub_uint8_t) grub_strtoul (val, 0, 10);
}
}
/* Use a small console by default. */
if (! grub_ofconsole_terminfo_output->width)
grub_ofconsole_terminfo_output->width = 80;
if (! grub_ofconsole_terminfo_output->height)
grub_ofconsole_terminfo_output->height = 24;
if (! grub_ofconsole_terminfo_output.width)
grub_ofconsole_terminfo_output.width = 80;
if (! grub_ofconsole_terminfo_output.height)
grub_ofconsole_terminfo_output.height = 24;
}
static void

View file

@ -23,6 +23,7 @@
#include <grub/misc.h>
#include <grub/cpu/io.h>
#include <grub/mm.h>
#include <grub/time.h>
#ifdef GRUB_MACHINE_PCBIOS
#include <grub/machine/memory.h>
@ -90,6 +91,8 @@ do_real_config (struct grub_serial_port *port)
if (port->configured)
return;
port->broken = 0;
divisor = serial_get_divisor (port->config.speed);
/* Turn off the interrupt. */
@ -145,18 +148,30 @@ serial_hw_fetch (struct grub_serial_port *port)
static void
serial_hw_put (struct grub_serial_port *port, const int c)
{
unsigned int timeout = 100000;
grub_uint64_t endtime;
do_real_config (port);
if (port->broken > 5)
endtime = grub_get_time_ms ();
else if (port->broken > 1)
endtime = grub_get_time_ms () + 50;
else
endtime = grub_get_time_ms () + 200;
/* Wait until the transmitter holding register is empty. */
while ((grub_inb (port->port + UART_LSR) & UART_EMPTY_TRANSMITTER) == 0)
{
if (--timeout == 0)
/* There is something wrong. But what can I do? */
return;
if (grub_get_time_ms () > endtime)
{
port->broken++;
/* There is something wrong. But what can I do? */
return;
}
}
if (port->broken)
port->broken--;
grub_outb (c, port->port + UART_TX);
}