Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 80693 | Differences between
and this patch

Collapse All | Expand All

(-)grub-0.96/stage2/char_io.c.orig (-6 / +31 lines)
Lines 1202-1235 Link Here
1202
}
1202
}
1203
#endif /* ! STAGE1_5 */
1203
#endif /* ! STAGE1_5 */
1204
1204
1205
#ifdef GRUB_UTIL
1206
# ifdef __PIC__
1207
#  if defined(HAVE_START_SYMBOL) && defined(HAVE_END_SYMBOL)
1208
      extern char start[];
1209
      extern char end[];
1210
#  elif defined(HAVE_USCORE_START_SYMBOL) && defined (HAVE_USCORE_END_SYMBOL)
1211
      extern char _start[];
1212
      extern char _end[];
1213
#  endif
1214
# endif
1215
#endif
1205
int
1216
int
1206
memcheck (int addr, int len)
1217
memcheck (int addr, int len)
1207
{
1218
{
1208
#ifdef GRUB_UTIL
1219
#ifdef GRUB_UTIL
1220
# ifdef __PIC__
1221
#  if defined(HAVE_START_SYMBOL) && defined(HAVE_END_SYMBOL)
1222
  if (start <= addr && end > addr + len)
1223
    return ! errnum;
1224
#  elif defined(HAVE_USCORE_START_SYMBOL) && defined (HAVE_USCORE_END_SYMBOL)
1225
  if (_start <= addr && _end > addr + len)
1226
    return ! errnum;
1227
#  endif
1228
# else /* __PIC__ */
1209
  static int start_addr (void)
1229
  static int start_addr (void)
1210
    {
1230
    {
1211
      int ret;
1231
      int ret;
1212
# if defined(HAVE_START_SYMBOL)
1232
#  if defined(HAVE_START_SYMBOL)
1213
      asm volatile ("movl	$start, %0" : "=a" (ret));
1233
      asm volatile ("movl	$start, %0" : "=a" (ret));
1214
# elif defined(HAVE_USCORE_START_SYMBOL)
1234
#  elif defined(HAVE_USCORE_START_SYMBOL)
1215
      asm volatile ("movl	$_start, %0" : "=a" (ret));
1235
      asm volatile ("movl	$_start, %0" : "=a" (ret));
1216
# endif
1236
#  else
1237
      erk! /* function would return undefined data in this case - barf */
1238
#  endif
1217
      return ret;
1239
      return ret;
1218
    }
1240
    }
1219
1241
1220
  static int end_addr (void)
1242
  static int end_addr (void)
1221
    {
1243
    {
1222
      int ret;
1244
      int ret;
1223
# if defined(HAVE_END_SYMBOL)
1245
#  if defined(HAVE_END_SYMBOL)
1224
      asm volatile ("movl	$end, %0" : "=a" (ret));
1246
      asm volatile ("movl	$end, %0" : "=a" (ret));
1225
# elif defined(HAVE_USCORE_END_SYMBOL)
1247
#  elif defined(HAVE_USCORE_END_SYMBOL)
1226
      asm volatile ("movl	$_end, %0" : "=a" (ret));
1248
      asm volatile ("movl	$_end, %0" : "=a" (ret));
1227
# endif
1249
#  else
1250
      erk! /* function would return undefined data in this case - barf */
1251
#  endif
1228
      return ret;
1252
      return ret;
1229
    }
1253
    }
1230
1254
1231
  if (start_addr () <= addr && end_addr () > addr + len)
1255
  if (start_addr () <= addr && end_addr () > addr + len)
1232
    return ! errnum;
1256
    return ! errnum;
1257
# endif /* __PIC__ */
1233
#endif /* GRUB_UTIL */
1258
#endif /* GRUB_UTIL */
1234
1259
1235
  if ((addr < RAW_ADDR (0x1000))
1260
  if ((addr < RAW_ADDR (0x1000))

Return to bug 80693