Lift up core size limits on some platforms. Fix potential memory

corruption with big core on small memory systems. Document remaining
	limits.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-03-07 08:17:24 +01:00
parent f6b58fe538
commit 774683685f
9 changed files with 210 additions and 32 deletions

View file

@ -64,6 +64,29 @@ struct grub_module_info64
grub_uint64_t size;
};
#ifndef GRUB_UTIL
/* Space isn't reusable on some platforms. */
/* On Qemu the preload space is readonly. */
/* On emu there is no preload space. */
/* On ieee1275 our code assumes that heap is p=v which isn't guaranteed for module space. */
#if defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_EMU) \
|| defined (GRUB_MACHINE_EFI) \
|| (defined (GRUB_MACHINE_IEEE1275) && !defined (__sparc__))
#define GRUB_KERNEL_PRELOAD_SPACE_REUSABLE 0
#endif
#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) \
|| defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) \
|| defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_ARC) \
|| defined (__sparc__)
/* FIXME: stack is between 2 heap regions. Move it. */
#define GRUB_KERNEL_PRELOAD_SPACE_REUSABLE 1
#endif
#ifndef GRUB_KERNEL_PRELOAD_SPACE_REUSABLE
#error "Please check if preload space is reusable on this platform!"
#endif
#if GRUB_TARGET_SIZEOF_VOID_P == 8
#define grub_module_info grub_module_info64
#else
@ -82,6 +105,8 @@ extern grub_addr_t EXPORT_VAR (grub_modbase);
grub_addr_t grub_modules_get_end (void);
#endif
/* The start point of the C code. */
void grub_main (void) __attribute__ ((noreturn));

View file

@ -91,6 +91,7 @@
#define GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08
#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200
#define GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR 0x100000
#define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000