2005-02-01 Yoshinori K. Okuji <okuji@enbug.org>
* grub/asmstub.c (grub_stage2): Use auto instead of static for nested functions. * stage2/char_io.c (memcheck) [GRUB_UTIL]: Likewise. * stage2/builtins.c (blocklist_func): Likewise. (color_func): Likewise. (install_func): Likewise. (setkey_func): Likewise. * lib/device.c (read_device_map): Likewise.
This commit is contained in:
parent
eb5d4d6776
commit
ac1ef04cde
7 changed files with 67 additions and 35 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2005-02-01 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
|
* grub/asmstub.c (grub_stage2): Use auto instead of static for
|
||||||
|
nested functions.
|
||||||
|
|
||||||
|
* stage2/char_io.c (memcheck) [GRUB_UTIL]: Likewise.
|
||||||
|
|
||||||
|
* stage2/builtins.c (blocklist_func): Likewise.
|
||||||
|
(color_func): Likewise.
|
||||||
|
(install_func): Likewise.
|
||||||
|
(setkey_func): Likewise.
|
||||||
|
|
||||||
|
* lib/device.c (read_device_map): Likewise.
|
||||||
|
|
||||||
2005-01-30 Yoshinori K. Okuji <okuji@enbug.org>
|
2005-01-30 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
* configure.ac (AC_INIT): Upgraded to 0.96.
|
* configure.ac (AC_INIT): Upgraded to 0.96.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
|
||||||
.TH GRUB "8" "January 2005" "grub (GNU GRUB 0.96)" FSF
|
.TH GRUB "8" "February 2005" "grub (GNU GRUB 0.96)" FSF
|
||||||
.SH NAME
|
.SH NAME
|
||||||
grub \- the grub shell
|
grub \- the grub shell
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
|
||||||
.TH MBCHK "1" "January 2005" "mbchk (GNU GRUB 0.96)" FSF
|
.TH MBCHK "1" "February 2005" "mbchk (GNU GRUB 0.96)" FSF
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mbchk \- check the format of a Multiboot kernel
|
mbchk \- check the format of a Multiboot kernel
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
|
@ -113,31 +113,33 @@ grub_stage2 (void)
|
||||||
char *scratch, *simstack;
|
char *scratch, *simstack;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
auto volatile void doit (void);
|
||||||
|
|
||||||
/* We need a nested function so that we get a clean stack frame,
|
/* We need a nested function so that we get a clean stack frame,
|
||||||
regardless of how the code is optimized. */
|
regardless of how the code is optimized. */
|
||||||
static volatile void doit ()
|
auto volatile void doit (void)
|
||||||
{
|
{
|
||||||
/* Make sure our stack lives in the simulated memory area. */
|
/* Make sure our stack lives in the simulated memory area. */
|
||||||
asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
|
asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
|
||||||
: "=&r" (realstack) : "r" (simstack));
|
: "=&r" (realstack) : "r" (simstack));
|
||||||
|
|
||||||
/* Do a setjmp here for the stop command. */
|
/* Do a setjmp here for the stop command. */
|
||||||
if (! setjmp (env_for_exit))
|
if (! setjmp (env_for_exit))
|
||||||
{
|
{
|
||||||
/* Actually enter the generic stage2 code. */
|
/* Actually enter the generic stage2 code. */
|
||||||
status = 0;
|
status = 0;
|
||||||
init_bios_info ();
|
init_bios_info ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If ERRNUM is non-zero, then set STATUS to non-zero. */
|
/* If ERRNUM is non-zero, then set STATUS to non-zero. */
|
||||||
if (errnum)
|
if (errnum)
|
||||||
status = 1;
|
status = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Replace our stack before we use any local variables. */
|
/* Replace our stack before we use any local variables. */
|
||||||
asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
|
asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (grub_scratch_mem == 0);
|
assert (grub_scratch_mem == 0);
|
||||||
scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
|
scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
|
||||||
|
|
|
@ -493,12 +493,15 @@ check_device (const char *device)
|
||||||
static int
|
static int
|
||||||
read_device_map (FILE *fp, char **map, const char *map_file)
|
read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
{
|
{
|
||||||
static void show_error (int no, const char *msg)
|
auto void show_error (int no, const char *msg);
|
||||||
|
auto void show_warning (int no, const char *msg, ...);
|
||||||
|
|
||||||
|
auto void show_error (int no, const char *msg)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
|
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_warning (int no, const char *msg, ...)
|
auto void show_warning (int no, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,11 @@ blocklist_func (char *arg, int flags)
|
||||||
int num_entries = 0;
|
int num_entries = 0;
|
||||||
int last_length = 0;
|
int last_length = 0;
|
||||||
|
|
||||||
|
auto void disk_read_blocklist_func (int sector, int offset, int length);
|
||||||
|
|
||||||
/* Collect contiguous blocks into one entry as many as possible,
|
/* Collect contiguous blocks into one entry as many as possible,
|
||||||
and print the blocklist notation on the screen. */
|
and print the blocklist notation on the screen. */
|
||||||
static void disk_read_blocklist_func (int sector, int offset, int length)
|
auto void disk_read_blocklist_func (int sector, int offset, int length)
|
||||||
{
|
{
|
||||||
if (num_sectors > 0)
|
if (num_sectors > 0)
|
||||||
{
|
{
|
||||||
|
@ -589,8 +591,10 @@ color_func (char *arg, int flags)
|
||||||
"white"
|
"white"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto int color_number (char *str);
|
||||||
|
|
||||||
/* Convert the color name STR into the magical number. */
|
/* Convert the color name STR into the magical number. */
|
||||||
static int color_number (char *str)
|
auto int color_number (char *str)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1774,8 +1778,11 @@ install_func (char *arg, int flags)
|
||||||
char *stage2_os_file = 0;
|
char *stage2_os_file = 0;
|
||||||
#endif /* GRUB_UTIL */
|
#endif /* GRUB_UTIL */
|
||||||
|
|
||||||
|
auto void disk_read_savesect_func (int sector, int offset, int length);
|
||||||
|
auto void disk_read_blocklist_func (int sector, int offset, int length);
|
||||||
|
|
||||||
/* Save the first sector of Stage2 in STAGE2_SECT. */
|
/* Save the first sector of Stage2 in STAGE2_SECT. */
|
||||||
static void disk_read_savesect_func (int sector, int offset, int length)
|
auto void disk_read_savesect_func (int sector, int offset, int length)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
printf ("[%d]", sector);
|
printf ("[%d]", sector);
|
||||||
|
@ -1791,7 +1798,7 @@ install_func (char *arg, int flags)
|
||||||
|
|
||||||
/* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
|
/* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
|
||||||
INSTALLSECT. */
|
INSTALLSECT. */
|
||||||
static void disk_read_blocklist_func (int sector, int offset, int length)
|
auto void disk_read_blocklist_func (int sector, int offset, int length)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("[%d]", sector);
|
printf("[%d]", sector);
|
||||||
|
@ -3610,7 +3617,10 @@ setkey_func (char *arg, int flags)
|
||||||
int to_code, from_code;
|
int to_code, from_code;
|
||||||
int map_in_interrupt = 0;
|
int map_in_interrupt = 0;
|
||||||
|
|
||||||
static int find_key_code (char *key)
|
auto int find_key_code (char *key);
|
||||||
|
auto int find_ascii_code (char *key);
|
||||||
|
|
||||||
|
auto int find_key_code (char *key)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -3627,7 +3637,7 @@ setkey_func (char *arg, int flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int find_ascii_code (char *key)
|
auto int find_ascii_code (char *key)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -1178,7 +1178,10 @@ int
|
||||||
memcheck (int addr, int len)
|
memcheck (int addr, int len)
|
||||||
{
|
{
|
||||||
#ifdef GRUB_UTIL
|
#ifdef GRUB_UTIL
|
||||||
static int start_addr (void)
|
auto int start_addr (void);
|
||||||
|
auto int end_addr (void);
|
||||||
|
|
||||||
|
auto int start_addr (void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
# if defined(HAVE_START_SYMBOL)
|
# if defined(HAVE_START_SYMBOL)
|
||||||
|
@ -1189,7 +1192,7 @@ memcheck (int addr, int len)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int end_addr (void)
|
auto int end_addr (void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
# if defined(HAVE_END_SYMBOL)
|
# if defined(HAVE_END_SYMBOL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue