/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#define GRUB_EFI_SHIFT_TO_INTERNAL(s) \
((((s) & GRUB_EFI_INPUTEX_RT_SHIFT) ? \
GRUB_TERM_SHIFT : 0) | \
(((s) & GRUB_EFI_INPUTEX_LT_SHIFT) ? \
GRUB_TERM_SHIFT : 0) | \
(((s) & GRUB_EFI_INPUTEX_RT_CTRL) ? \
GRUB_TERM_CTRL : 0) | \
(((s) & GRUB_EFI_INPUTEX_LT_CTRL) ? \
GRUB_TERM_CTRL : 0) | \
(((s) & GRUB_EFI_INPUTEX_RT_ALT) ? \
GRUB_TERM_ALT : 0) | \
(((s) & GRUB_EFI_INPUTEX_LT_ALT) ? \
GRUB_TERM_ALT : 0))
static grub_uint32_t
{
/* Map some unicode characters to the EFI character. */
switch (c)
{
case GRUB_UNICODE_LEFTARROW:
break;
case GRUB_UNICODE_UPARROW:
break;
case GRUB_UNICODE_RIGHTARROW:
break;
case GRUB_UNICODE_DOWNARROW:
break;
case GRUB_UNICODE_HLINE:
break;
case GRUB_UNICODE_VLINE:
break;
case GRUB_UNICODE_CORNER_UL:
break;
case GRUB_UNICODE_CORNER_UR:
break;
case GRUB_UNICODE_CORNER_LL:
break;
case GRUB_UNICODE_CORNER_LR:
break;
}
return c;
}
static void
const struct grub_unicode_glyph *c)
{
unsigned i, j;
if (grub_efi_is_finished)
return;
o = grub_efi_system_table->con_out;
/* For now, do not try to use a surrogate pair. */
if (c->base > 0xffff)
str[0] = '?';
else
j = 1;
for (i = 0; i < c->ncomb; i++)
if (c->base < 0xffff)
str[j] = 0;
/* Should this test be cached? */
return;
}
const unsigned efi_codes[] =
{
GRUB_TERM_KEY_F10, 0, 0, '\e'
};
static int
{
return 1;
return 0;
}
static int
{
int mods = 0;
if (grub_efi_is_finished)
return 0;
if (stiex)
else
{
i = grub_efi_system_table->con_in;
}
if (status != GRUB_EFI_SUCCESS)
return GRUB_TERM_NO_KEY;
{
if (need_unshift(c))
mods &= ~GRUB_TERM_SHIFT;
if (c == 0x7f)
c = '\b';
if (c == '\t' || c == '\b' || c == '\n' || c == '\r')
mods &= ~GRUB_TERM_CTRL;
else if (c < 0x20)
mods |= GRUB_TERM_CTRL;
return c | mods;
}
return GRUB_TERM_NO_KEY;
}
static grub_uint16_t
{
o = grub_efi_system_table->con_out;
{
/* Why does this fail? */
columns = 80;
rows = 25;
}
}
static grub_uint16_t
{
if (grub_efi_is_finished)
return 0;
o = grub_efi_system_table->con_out;
}
static void
grub_uint8_t x, grub_uint8_t y)
{
if (grub_efi_is_finished)
return;
o = grub_efi_system_table->con_out;
efi_call_3 (o->set_cursor_position, o, x, y);
}
static void
{
if (grub_efi_is_finished)
return;
o = grub_efi_system_table->con_out;
efi_call_1 (o->clear_screen, o);
}
static void
{
if (grub_efi_is_finished)
return;
o = grub_efi_system_table->con_out;
switch (state) {
case GRUB_TERM_COLOR_STANDARD:
& 0x7f);
break;
case GRUB_TERM_COLOR_NORMAL:
break;
break;
default:
break;
}
}
static void
int on)
{
if (grub_efi_is_finished)
return;
o = grub_efi_system_table->con_out;
}
static grub_err_t
{
return 0;
}
static grub_err_t
{
grub_console_setcursor (term, 0);
return 0;
}
{
.name = "console",
};
{
.name = "console",
.cls = grub_console_cls,
};
void
grub_console_init (void)
{
/* FIXME: it is necessary to consider the case where no console control
is present but the default is already in text mode. */
if (! grub_efi_set_text_mode (1))
{
return;
}
}
void
grub_console_fini (void)
{
}