MErge mainline into lexer-rewrite

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-23 19:37:13 +01:00
commit 6c624ae848
7 changed files with 75 additions and 14 deletions

View File

@ -1,3 +1,23 @@
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_setcolorstate): Allocate on
stack since heap may be unavailable at that point.
(grub_ofconsole_gotoxy): Likewise.
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Check for _restgpr_14_x.
* include/grub/powerpc/libgcc.h [HAVE__RESTGPR_14_X]: Add _restgpr_*_x
and _savegpr_* prototypes.
2010-01-22 Robert Millan <rmh.grub@aybabtu.com>
Use generic grub_reboot() for i386-efi.
* kern/efi/efi.c [__i386__] (grub_reboot): Remove.
* kern/i386/efi/startup.S: Include `"../realmode.S"'.
* kern/i386/realmode.S: Include `<grub/i386/pc/memory.h>'.
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* kern/ieee1275/init.c (grub_machine_set_prefix): Don't check for

View File

@ -444,7 +444,7 @@ AC_SUBST(TARGET_CPPFLAGS)
AC_SUBST(TARGET_LDFLAGS)
# Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS)
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2)
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x)
# Set them to their new values for the tests below.
CC="$TARGET_CC"

View File

@ -33,3 +33,42 @@ void EXPORT_FUNC (__trampoline_setup) (void);
#ifdef HAVE___UCMPDI2
void EXPORT_FUNC (__ucmpdi2) (void);
#endif
#ifdef HAVE__RESTGPR_14_X
void EXPORT_FUNC (_restgpr_14_x) (void);
void EXPORT_FUNC (_restgpr_15_x) (void);
void EXPORT_FUNC (_restgpr_16_x) (void);
void EXPORT_FUNC (_restgpr_17_x) (void);
void EXPORT_FUNC (_restgpr_18_x) (void);
void EXPORT_FUNC (_restgpr_19_x) (void);
void EXPORT_FUNC (_restgpr_20_x) (void);
void EXPORT_FUNC (_restgpr_21_x) (void);
void EXPORT_FUNC (_restgpr_22_x) (void);
void EXPORT_FUNC (_restgpr_23_x) (void);
void EXPORT_FUNC (_restgpr_24_x) (void);
void EXPORT_FUNC (_restgpr_25_x) (void);
void EXPORT_FUNC (_restgpr_26_x) (void);
void EXPORT_FUNC (_restgpr_27_x) (void);
void EXPORT_FUNC (_restgpr_28_x) (void);
void EXPORT_FUNC (_restgpr_29_x) (void);
void EXPORT_FUNC (_restgpr_30_x) (void);
void EXPORT_FUNC (_restgpr_31_x) (void);
void EXPORT_FUNC (_savegpr_14) (void);
void EXPORT_FUNC (_savegpr_15) (void);
void EXPORT_FUNC (_savegpr_16) (void);
void EXPORT_FUNC (_savegpr_17) (void);
void EXPORT_FUNC (_savegpr_18) (void);
void EXPORT_FUNC (_savegpr_19) (void);
void EXPORT_FUNC (_savegpr_20) (void);
void EXPORT_FUNC (_savegpr_21) (void);
void EXPORT_FUNC (_savegpr_22) (void);
void EXPORT_FUNC (_savegpr_23) (void);
void EXPORT_FUNC (_savegpr_24) (void);
void EXPORT_FUNC (_savegpr_25) (void);
void EXPORT_FUNC (_savegpr_26) (void);
void EXPORT_FUNC (_savegpr_27) (void);
void EXPORT_FUNC (_savegpr_28) (void);
void EXPORT_FUNC (_savegpr_29) (void);
void EXPORT_FUNC (_savegpr_30) (void);
void EXPORT_FUNC (_savegpr_31) (void);
#endif

View File

@ -1,7 +1,7 @@
/* efi.c - generic EFI support */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -162,6 +162,8 @@ grub_exit (void)
for (;;) ;
}
/* On i386, a firmware-independant grub_reboot() is provided by realmode.S. */
#ifndef __i386__
void
grub_reboot (void)
{
@ -169,6 +171,7 @@ grub_reboot (void)
efi_call_4 (grub_efi_system_table->runtime_services->reset_system,
GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL);
}
#endif
void
grub_halt (void)

View File

@ -1,7 +1,7 @@
/* startup.S - bootstrap GRUB itself */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -62,3 +62,5 @@ codestart:
movl %eax, EXT_C(grub_efi_system_table)
call EXT_C(grub_main)
ret
#include "../realmode.S"

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +16,7 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/i386/pc/memory.h>
/*
* Note: These functions defined in this file may be called from C.

View File

@ -109,7 +109,7 @@ grub_ofconsole_getcharwidth (grub_uint32_t c __attribute__((unused)))
static void
grub_ofconsole_setcolorstate (grub_term_color_state state)
{
char *setcol;
char setcol[256];
int fg;
int bg;
@ -128,10 +128,8 @@ grub_ofconsole_setcolorstate (grub_term_color_state state)
return;
}
setcol = grub_xasprintf ("\e[3%dm\e[4%dm", fg, bg);
if (setcol)
grub_ofconsole_writeesc (setcol);
grub_free (setcol);
grub_snprintf (setcol, sizeof (setcol), "\e[3%dm\e[4%dm", fg, bg);
grub_ofconsole_writeesc (setcol);
}
static void
@ -288,14 +286,12 @@ grub_ofconsole_gotoxy (grub_uint8_t x, grub_uint8_t y)
{
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI))
{
char *s;
char s[256];
grub_curr_x = x;
grub_curr_y = y;
s = grub_xasprintf ("\e[%d;%dH", y + 1, x + 1);
if (s)
grub_ofconsole_writeesc (s);
grub_free (s);
grub_snprintf (s, sizeof (s), "\e[%d;%dH", y + 1, x + 1);
grub_ofconsole_writeesc (s);
}
else
{