fix the memcheck problem in the grub shell.

This commit is contained in:
okuji 1999-09-17 18:35:23 +00:00
parent d6279335bb
commit 84bf7c7d5d
10 changed files with 492 additions and 32 deletions

View file

@ -1,3 +1,39 @@
1999-09-18 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* acinclude.m4 (grub_CHECK_START_SYMBOL): New function.
(grub_CHECK_USCORE_START_SYMBOL): Likewise.
(grub_CHECK_END_SYMBOL): Likewise.
(grub_CHECK_USCORE_SYMBOL): Likewise.
* configure.in: Call grub_CHECK_START_SYMBOL and
grub_CHECK_USCORE_START_SYMBOL, and if neither start nor _start
is defined, print an error message and exit.
Likewise, call grub_CHECK_END_SYMBOL and
grub_CHECK_USCORE_END_SYMBOL, and if neither end nor _end is
defined, print an error message and exit.
* acconfig.h (HAVE_START_SYMBOL): Added the "undef" entry.
(HAVE_USCORE_START_SYMBOL): Likewise.
(HAVE_END_SYMBOL): Likewise.
(HAVE_USCORE_END_SYMBOL): Likewise.
* stage2/char_io.c (memcheck): Rename the argument START to
ADDR. Added two missing equal characters.
[GRUB_UTIL]: Define new local functions start_addr and end_addr.
[GRUB_UTIL && HAVE_START_SYMBOL]: The function start_addr
returns START.
[GRUB_UTIL && HAVE_USCORE_START_SYMBOL]: The function start_addr
returns _START.
[GRUB_UTIL && HAVE_END_SYMBOL]: The function end_addr returns
END.
[GRUB_UTIL && HAVE_USCORE_END_SYMBOL]: The function end_addr
returns _END.
[GRUB_UTIL]: If ADDR is equal to or greater than the address
returned by start_addr, and ADDR plus LEN is less than the
address returned by end_addr, return ! ERRNUM.
* stage2/asm.S (get_code_end) [HAVE_END_SYMBOL]: Use $end as the
end of the bss.
[HAVE_USCORE_END_SYMBOL]: Use $_end as the end of the bss.
* stage2/disk_io.c [!STAGE1_5] (cur_part_desc): Made static.
Need not to be global any longer.
1999-09-17 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/char_io.c [!STAGE1_5] (get_cmdline): The argument

View file

@ -9,3 +9,15 @@
/* Defined if you have a curses library (ncurses preferred). */
#undef HAVE_LIBCURSES
/* Defined if start is defined. */
#undef HAVE_START_SYMBOL
/* Defined if _start is defined. */
#undef HAVE_USCORE_START_SYMBOL
/* Defined if end is defined. */
#undef HAVE_END_SYMBOL
/* Defined if _end is defined. */
#undef HAVE_USCORE_END_SYMBOL

View file

@ -123,3 +123,119 @@ else
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_asm_prefix_requirement])])
dnl
dnl grub_CHECK_START_SYMBOL checks if start is automatically defined by
dnl the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_START_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if start is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_start_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl start");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_start_symbol=yes
AC_DEFINE([HAVE_START_SYMBOL])
else
grub_cv_check_start_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_start_symbol])
])
dnl
dnl grub_CHECK_USCORE_START_SYMBOL checks if _start is automatically
dnl defined by the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_USCORE_START_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if _start is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_uscore_start_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _start");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_uscore_start_symbol=yes
AC_DEFINE([HAVE_USCORE_START_SYMBOL])
else
grub_cv_check_uscore_start_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
])
dnl
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
dnl compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_END_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if end is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_end_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl end);
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_end_symbol=yes
AC_DEFINE([HAVE_END_SYMBOL])
else
grub_cv_check_end_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_end_symbol])
])
dnl
dnl grub_CHECK_USCORE_END_SYMBOL checks if _end is automatically defined
dnl by the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_USCORE_END_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if _end is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_uscore_end_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _end");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_uscore_end_symbol=yes
AC_DEFINE([HAVE_USCORE_END_SYMBOL])
else
grub_cv_check_uscore_end_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol])
])

116
aclocal.m4 vendored
View file

@ -136,6 +136,122 @@ fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_asm_prefix_requirement])])
dnl
dnl grub_CHECK_START_SYMBOL checks if start is automatically defined by
dnl the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_START_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if start is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_start_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl start");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_start_symbol=yes
AC_DEFINE([HAVE_START_SYMBOL])
else
grub_cv_check_start_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_start_symbol])
])
dnl
dnl grub_CHECK_USCORE_START_SYMBOL checks if _start is automatically
dnl defined by the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_USCORE_START_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if _start is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_uscore_start_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _start");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_uscore_start_symbol=yes
AC_DEFINE([HAVE_USCORE_START_SYMBOL])
else
grub_cv_check_uscore_start_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
])
dnl
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
dnl compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_END_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if end is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_end_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl end);
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_end_symbol=yes
AC_DEFINE([HAVE_END_SYMBOL])
else
grub_cv_check_end_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_end_symbol])
])
dnl
dnl grub_CHECK_USCORE_END_SYMBOL checks if _end is automatically defined
dnl by the compiler.
dnl Written by OKUJI Yoshinori
AC_DEFUN(grub_CHECK_USCORE_END_SYMBOL,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([if _end is defined by the compiler])
AC_CACHE_VAL(grub_cv_check_uscore_end_symbol,
[cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _end");
return 0;
}
EOF
if AC_TRY_COMMAND([${CC-cc} conftest.c -o conftest]) && test -s conftest; then
grub_cv_check_uscore_end_symbol=yes
AC_DEFINE([HAVE_USCORE_END_SYMBOL])
else
grub_cv_check_uscore_end_symbol=no
fi
rm -f conftest*])
AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol])
])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.

View file

@ -9,6 +9,18 @@
/* Defined if you have a curses library (ncurses preferred). */
#undef HAVE_LIBCURSES
/* Defined if start is defined. */
#undef HAVE_START_SYMBOL
/* Defined if _start is defined. */
#undef HAVE_USCORE_START_SYMBOL
/* Defined if end is defined. */
#undef HAVE_END_SYMBOL
/* Defined if _end is defined. */
#undef HAVE_USCORE_END_SYMBOL
/* Define if you have the <curses.h> header file. */
#undef HAVE_CURSES_H

166
configure vendored
View file

@ -1625,9 +1625,143 @@ EOF
fi
echo $ac_n "checking if start is defined by the compiler""... $ac_c" 1>&6
echo "configure:1631: checking if start is defined by the compiler" >&5
if eval "test \"\${grub_cv_check_start_symbol+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl start");
return 0;
}
EOF
if { ac_try='${CC-cc} conftest.c -o conftest'; { (eval echo configure:1644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest; then
grub_cv_check_start_symbol=yes
cat >> confdefs.h <<\EOF
#define HAVE_START_SYMBOL 1
EOF
else
grub_cv_check_start_symbol=no
fi
rm -f conftest*
fi
echo "$ac_t""$grub_cv_check_start_symbol" 1>&6
echo $ac_n "checking if _start is defined by the compiler""... $ac_c" 1>&6
echo "configure:1662: checking if _start is defined by the compiler" >&5
if eval "test \"\${grub_cv_check_uscore_start_symbol+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _start");
return 0;
}
EOF
if { ac_try='${CC-cc} conftest.c -o conftest'; { (eval echo configure:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest; then
grub_cv_check_uscore_start_symbol=yes
cat >> confdefs.h <<\EOF
#define HAVE_USCORE_START_SYMBOL 1
EOF
else
grub_cv_check_uscore_start_symbol=no
fi
rm -f conftest*
fi
echo "$ac_t""$grub_cv_check_uscore_start_symbol" 1>&6
if test "x$grub_cv_check_start_symbol" != "xyes" \
-a "x$grub_cv_check_uscore_start_symbol" != "xyes"; then
{ echo "configure: error: Neither start nor _start is defined" 1>&2; exit 1; }
fi
echo $ac_n "checking if end is defined by the compiler""... $ac_c" 1>&6
echo "configure:1698: checking if end is defined by the compiler" >&5
if eval "test \"\${grub_cv_check_end_symbol+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl end);
return 0;
}
EOF
if { ac_try='${CC-cc} conftest.c -o conftest'; { (eval echo configure:1711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest; then
grub_cv_check_end_symbol=yes
cat >> confdefs.h <<\EOF
#define HAVE_END_SYMBOL 1
EOF
else
grub_cv_check_end_symbol=no
fi
rm -f conftest*
fi
echo "$ac_t""$grub_cv_check_end_symbol" 1>&6
echo $ac_n "checking if _end is defined by the compiler""... $ac_c" 1>&6
echo "configure:1729: checking if _end is defined by the compiler" >&5
if eval "test \"\${grub_cv_check_uscore_end_symbol+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
int
main (void)
{
asm ("incl _end");
return 0;
}
EOF
if { ac_try='${CC-cc} conftest.c -o conftest'; { (eval echo configure:1742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest; then
grub_cv_check_uscore_end_symbol=yes
cat >> confdefs.h <<\EOF
#define HAVE_USCORE_END_SYMBOL 1
EOF
else
grub_cv_check_uscore_end_symbol=no
fi
rm -f conftest*
fi
echo "$ac_t""$grub_cv_check_uscore_end_symbol" 1>&6
if test "x$grub_cv_check_end_symbol" != "xyes" \
-a "x$grub_cv_check_uscore_end_symbol" != "xyes"; then
{ echo "configure: error: Neither end nor _end is defined" 1>&2; exit 1; }
fi
# Check for curses libraries.
echo $ac_n "checking for wgetch in -lncurses""... $ac_c" 1>&6
echo "configure:1631: checking for wgetch in -lncurses" >&5
echo "configure:1765: checking for wgetch in -lncurses" >&5
ac_lib_var=`echo ncurses'_'wgetch | sed 'y%./+-:%__p__%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1635,7 +1769,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1639 "configure"
#line 1773 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1646,7 +1780,7 @@ int main() {
wgetch()
; return 0; }
EOF
if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1669,7 +1803,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for wgetch in -lcurses""... $ac_c" 1>&6
echo "configure:1673: checking for wgetch in -lcurses" >&5
echo "configure:1807: checking for wgetch in -lcurses" >&5
ac_lib_var=`echo curses'_'wgetch | sed 'y%./+-:%__p__%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1677,7 +1811,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1681 "configure"
#line 1815 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1688,7 +1822,7 @@ int main() {
wgetch()
; return 0; }
EOF
if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1718,7 +1852,7 @@ fi
# Check for headers.
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1722: checking how to run the C preprocessor" >&5
echo "configure:1856: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -1733,13 +1867,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1737 "configure"
#line 1871 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1750,13 +1884,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1754 "configure"
#line 1888 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1767,13 +1901,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1771 "configure"
#line 1905 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1801,17 +1935,17 @@ for ac_hdr in string.h strings.h ncurses/curses.h ncurses.h curses.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1805: checking for $ac_hdr" >&5
echo "configure:1939: checking for $ac_hdr" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1810 "configure"
#line 1944 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*

View file

@ -106,6 +106,20 @@ else
AC_DEFINE_UNQUOTED([DATA32], [data32])
fi
grub_CHECK_START_SYMBOL
grub_CHECK_USCORE_START_SYMBOL
if test "x$grub_cv_check_start_symbol" != "xyes" \
-a "x$grub_cv_check_uscore_start_symbol" != "xyes"; then
AC_MSG_ERROR([Neither start nor _start is defined])
fi
grub_CHECK_END_SYMBOL
grub_CHECK_USCORE_END_SYMBOL
if test "x$grub_cv_check_end_symbol" != "xyes" \
-a "x$grub_cv_check_uscore_end_symbol" != "xyes"; then
AC_MSG_ERROR([Neither end nor _end is defined])
fi
# Check for curses libraries.
AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses"
AC_DEFINE(HAVE_LIBCURSES)],

View file

@ -773,7 +773,12 @@ pc_notnewline:
* This is here so that it can be replaced by asmstub.c.
*/
ENTRY(get_code_end)
movl $EXT_C(end), %eax /* will be the end of the bss */
/* will be the end of the bss */
# if defined(HAVE_END_SYMBOL)
movl $end, %eax
# elif defined(HAVE_USCORE_END_SYMBOL)
movl $_end, %eax
# endif
shrl $2, %eax /* Round up to the next word. */
incl %eax
shll $2, %eax

View file

@ -790,23 +790,40 @@ grub_strlen (const char *str)
int
memcheck (int start, int len)
memcheck (int addr, int len)
{
#ifdef GRUB_UTIL
/* FIXME: cur_part_desc is the only global variable that we memmove
to. We should fix this so that we don't need a special case
(i.e. so that it lives on the stack, or somewhere inside
grub_scratch_mem). */
extern char cur_part_desc[];
if (start >= (int) cur_part_desc && start + len <= (int) cur_part_desc + 16)
static int start_addr (void)
{
int ret;
# if defined(HAVE_START_SYMBOL)
asm volatile ("movl $start, %0" : "=a" (ret));
# elif defined(HAVE_USCORE_START_SYMBOL)
asm volatile ("movl $_start, %0" : "=a" (ret));
# endif
return ret;
}
static int end_addr (void)
{
int ret;
# if defined(HAVE_END_SYMBOL)
asm volatile ("movl $end, %0" : "=a" (ret));
# elif defined(HAVE_USCORE_END_SYMBOL)
asm volatile ("movl $_end, %0" : "=a" (ret));
# endif
return ret;
}
if (start_addr () <= addr && end_addr () > addr + len)
return ! errnum;
#endif /* GRUB_UTIL */
if ((start < RAW_ADDR (0x1000)) ||
(start < RAW_ADDR (0x100000) &&
RAW_ADDR (mbi.mem_lower * 1024) < (start + len)) ||
(start >= RAW_ADDR (0x100000) &&
RAW_ADDR (mbi.mem_upper * 1024) < ((start - 0x100000) + len)))
if ((addr < RAW_ADDR (0x1000))
|| (addr < RAW_ADDR (0x100000)
&& RAW_ADDR (mbi.mem_lower * 1024) <= (addr + len))
|| (addr >= RAW_ADDR (0x100000)
&& RAW_ADDR (mbi.mem_upper * 1024) <= ((addr - 0x100000) + len)))
errnum = ERR_WONT_FIT;
return ! errnum;

View file

@ -437,10 +437,8 @@ check_BSD_parts (int flags)
}
/* This isn't static, because the GRUB utility's char_io.c (memcheck)
needs to know about it as a special case. */
#ifndef STAGE1_5
char cur_part_desc[16];
static char cur_part_desc[16];
#endif
static int