merge mainline into mips
This commit is contained in:
commit
85a2cf749f
230 changed files with 7727 additions and 3654 deletions
|
@ -73,7 +73,7 @@ static char keyboard_map_shift[128] =
|
|||
static grub_uint8_t grub_keyboard_controller_orig;
|
||||
|
||||
static void
|
||||
keyboard_controller_wait_untill_ready ()
|
||||
keyboard_controller_wait_until_ready (void)
|
||||
{
|
||||
while (! KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS)));
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ keyboard_controller_wait_untill_ready ()
|
|||
static void
|
||||
grub_keyboard_controller_write (grub_uint8_t c)
|
||||
{
|
||||
keyboard_controller_wait_untill_ready ();
|
||||
keyboard_controller_wait_until_ready ();
|
||||
grub_outb (KEYBOARD_COMMAND_WRITE, KEYBOARD_REG_STATUS);
|
||||
grub_outb (c, KEYBOARD_REG_DATA);
|
||||
}
|
||||
|
@ -89,18 +89,18 @@ grub_keyboard_controller_write (grub_uint8_t c)
|
|||
static grub_uint8_t
|
||||
grub_keyboard_controller_read (void)
|
||||
{
|
||||
keyboard_controller_wait_untill_ready ();
|
||||
keyboard_controller_wait_until_ready ();
|
||||
grub_outb (KEYBOARD_COMMAND_READ, KEYBOARD_REG_STATUS);
|
||||
return grub_inb (KEYBOARD_REG_DATA);
|
||||
}
|
||||
|
||||
static void
|
||||
keyboard_controller_led (grub_uint8_t led_status)
|
||||
keyboard_controller_led (grub_uint8_t leds)
|
||||
{
|
||||
keyboard_controller_wait_untill_ready ();
|
||||
keyboard_controller_wait_until_ready ();
|
||||
grub_outb (0xed, KEYBOARD_REG_DATA);
|
||||
keyboard_controller_wait_untill_ready ();
|
||||
grub_outb (led_status & 0x7, KEYBOARD_REG_DATA);
|
||||
keyboard_controller_wait_until_ready ();
|
||||
grub_outb (leds & 0x7, KEYBOARD_REG_DATA);
|
||||
}
|
||||
|
||||
/* FIXME: This should become an interrupt service routine. For now
|
||||
|
|
|
@ -351,8 +351,7 @@ static struct grub_term_output grub_console_term_output =
|
|||
.setcolorstate = grub_console_setcolorstate,
|
||||
.setcolor = grub_console_setcolor,
|
||||
.getcolor = grub_console_getcolor,
|
||||
.setcursor = grub_console_setcursor,
|
||||
.flags = 0,
|
||||
.setcursor = grub_console_setcursor
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <grub/bitmap.h>
|
||||
#include <grub/command.h>
|
||||
|
||||
#define DEFAULT_VIDEO_MODE "1024x768,800x600,640x480"
|
||||
#define DEFAULT_VIDEO_MODE "1024x768,800x600,640x480,0x0"
|
||||
#define DEFAULT_BORDER_WIDTH 10
|
||||
|
||||
#define DEFAULT_STANDARD_COLOR 0x07
|
||||
|
|
|
@ -65,8 +65,7 @@ static struct grub_term_output grub_console_term_output =
|
|||
.setcolorstate = grub_console_setcolorstate,
|
||||
.setcolor = grub_console_setcolor,
|
||||
.getcolor = grub_console_getcolor,
|
||||
.setcursor = grub_console_setcursor,
|
||||
.flags = 0,
|
||||
.setcursor = grub_console_setcursor
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -79,10 +78,6 @@ grub_console_init (void)
|
|||
void
|
||||
grub_console_fini (void)
|
||||
{
|
||||
/* This is to make sure the console is restored to text mode before
|
||||
we boot. */
|
||||
grub_term_set_current_output (&grub_console_term_output);
|
||||
|
||||
grub_term_unregister_input (&grub_console_term_input);
|
||||
grub_term_unregister_output (&grub_console_term_output);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ grub_ofconsole_putchar (grub_uint32_t c)
|
|||
grub_curr_x++;
|
||||
if (grub_curr_x > grub_ofconsole_width)
|
||||
{
|
||||
grub_putcode ('\n');
|
||||
grub_ofconsole_putchar ('\n');
|
||||
grub_curr_x++;
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ grub_ofconsole_cls (void)
|
|||
* ANSI escape sequence. Using video console, Apple Open Firmware (version
|
||||
* 3.1.1) only recognizes the literal ^L. So use both. */
|
||||
grub_ofconsole_writeesc ("\e[2J");
|
||||
grub_gotoxy (0, 0);
|
||||
grub_ofconsole_gotoxy (0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -414,8 +414,7 @@ static struct grub_term_output grub_ofconsole_term_output =
|
|||
.setcolor = grub_ofconsole_setcolor,
|
||||
.getcolor = grub_ofconsole_getcolor,
|
||||
.setcursor = grub_ofconsole_setcursor,
|
||||
.refresh = grub_ofconsole_refresh,
|
||||
.flags = 0,
|
||||
.refresh = grub_ofconsole_refresh
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <grub/terminfo.h>
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#define TEXT_WIDTH 80
|
||||
#define TEXT_HEIGHT 24
|
||||
|
@ -37,15 +38,17 @@ static unsigned int registered = 0;
|
|||
static char input_buf[8];
|
||||
static unsigned int npending = 0;
|
||||
|
||||
static struct grub_term_output grub_serial_term_output;
|
||||
|
||||
/* Argument options. */
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"unit", 'u', 0, "Set the serial unit", 0, ARG_TYPE_INT},
|
||||
{"port", 'p', 0, "Set the serial port address", 0, ARG_TYPE_STRING},
|
||||
{"speed", 's', 0, "Set the serial port speed", 0, ARG_TYPE_INT},
|
||||
{"word", 'w', 0, "Set the serial port word length", 0, ARG_TYPE_INT},
|
||||
{"parity", 'r', 0, "Set the serial port parity", 0, ARG_TYPE_STRING},
|
||||
{"stop", 't', 0, "Set the serial port stop bits", 0, ARG_TYPE_INT},
|
||||
{"unit", 'u', 0, N_("Set the serial unit."), 0, ARG_TYPE_INT},
|
||||
{"port", 'p', 0, N_("Set the serial port address."), 0, ARG_TYPE_STRING},
|
||||
{"speed", 's', 0, N_("Set the serial port speed."), 0, ARG_TYPE_INT},
|
||||
{"word", 'w', 0, N_("Set the serial port word length."), 0, ARG_TYPE_INT},
|
||||
{"parity", 'r', 0, N_("Set the serial port parity."), 0, ARG_TYPE_STRING},
|
||||
{"stop", 't', 0, N_("Set the serial port stop bits."), 0, ARG_TYPE_INT},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -416,7 +419,7 @@ grub_serial_gotoxy (grub_uint8_t x, grub_uint8_t y)
|
|||
else
|
||||
{
|
||||
keep_track = 0;
|
||||
grub_terminfo_gotoxy (x, y);
|
||||
grub_terminfo_gotoxy (x, y, &grub_serial_term_output);
|
||||
keep_track = 1;
|
||||
|
||||
xpos = x;
|
||||
|
@ -428,7 +431,7 @@ static void
|
|||
grub_serial_cls (void)
|
||||
{
|
||||
keep_track = 0;
|
||||
grub_terminfo_cls ();
|
||||
grub_terminfo_cls (&grub_serial_term_output);
|
||||
keep_track = 1;
|
||||
|
||||
xpos = ypos = 0;
|
||||
|
@ -442,10 +445,10 @@ grub_serial_setcolorstate (const grub_term_color_state state)
|
|||
{
|
||||
case GRUB_TERM_COLOR_STANDARD:
|
||||
case GRUB_TERM_COLOR_NORMAL:
|
||||
grub_terminfo_reverse_video_off ();
|
||||
grub_terminfo_reverse_video_off (&grub_serial_term_output);
|
||||
break;
|
||||
case GRUB_TERM_COLOR_HIGHLIGHT:
|
||||
grub_terminfo_reverse_video_on ();
|
||||
grub_terminfo_reverse_video_on (&grub_serial_term_output);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -457,9 +460,9 @@ static void
|
|||
grub_serial_setcursor (const int on)
|
||||
{
|
||||
if (on)
|
||||
grub_terminfo_cursor_on ();
|
||||
grub_terminfo_cursor_on (&grub_serial_term_output);
|
||||
else
|
||||
grub_terminfo_cursor_off ();
|
||||
grub_terminfo_cursor_off (&grub_serial_term_output);
|
||||
}
|
||||
|
||||
static struct grub_term_input grub_serial_term_input =
|
||||
|
|
|
@ -108,52 +108,52 @@ grub_terminfo_set_current (const char *str)
|
|||
|
||||
/* Wrapper for grub_putchar to write strings. */
|
||||
static void
|
||||
putstr (const char *str)
|
||||
putstr (const char *str, grub_term_output_t oterm)
|
||||
{
|
||||
while (*str)
|
||||
grub_putchar (*str++);
|
||||
grub_putcode (*str++, oterm);
|
||||
}
|
||||
|
||||
/* Move the cursor to the given position starting with "0". */
|
||||
void
|
||||
grub_terminfo_gotoxy (grub_uint8_t x, grub_uint8_t y)
|
||||
grub_terminfo_gotoxy (grub_uint8_t x, grub_uint8_t y, grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.gotoxy, y, x));
|
||||
putstr (grub_terminfo_tparm (term.gotoxy, y, x), oterm);
|
||||
}
|
||||
|
||||
/* Clear the screen. */
|
||||
void
|
||||
grub_terminfo_cls (void)
|
||||
grub_terminfo_cls (grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.cls));
|
||||
putstr (grub_terminfo_tparm (term.cls), oterm);
|
||||
}
|
||||
|
||||
/* Set reverse video mode on. */
|
||||
void
|
||||
grub_terminfo_reverse_video_on (void)
|
||||
grub_terminfo_reverse_video_on (grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.reverse_video_on));
|
||||
putstr (grub_terminfo_tparm (term.reverse_video_on), oterm);
|
||||
}
|
||||
|
||||
/* Set reverse video mode off. */
|
||||
void
|
||||
grub_terminfo_reverse_video_off (void)
|
||||
grub_terminfo_reverse_video_off (grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.reverse_video_off));
|
||||
putstr (grub_terminfo_tparm (term.reverse_video_off), oterm);
|
||||
}
|
||||
|
||||
/* Show cursor. */
|
||||
void
|
||||
grub_terminfo_cursor_on (void)
|
||||
grub_terminfo_cursor_on (grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.cursor_on));
|
||||
putstr (grub_terminfo_tparm (term.cursor_on), oterm);
|
||||
}
|
||||
|
||||
/* Hide cursor. */
|
||||
void
|
||||
grub_terminfo_cursor_off (void)
|
||||
grub_terminfo_cursor_off (grub_term_output_t oterm)
|
||||
{
|
||||
putstr (grub_terminfo_tparm (term.cursor_off));
|
||||
putstr (grub_terminfo_tparm (term.cursor_off), oterm);
|
||||
}
|
||||
|
||||
/* GRUB Command. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue