2004-10-13 Hollis Blanchard <hollis@penguinppc.org>

* include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
        prototype.
        * kern/powerpc/ieee1275/init.c (grub_machine_init): Call
        grub_console_init first.
        Change the memory range used for grub_ieee1275_claim and
        grub_mm_init_region.
        Print an error message if the claim fails.
        Include <grub/misc.h>.
This commit is contained in:
hollisb 2004-10-15 02:29:11 +00:00
parent d1923dc8f2
commit 3891222854
3 changed files with 33 additions and 6 deletions

View file

@ -1,3 +1,14 @@
2004-10-14 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/powerpc/ieee1275/ieee1275.h (abort): Add function
prototype.
* kern/powerpc/ieee1275/init.c (grub_machine_init): Call
grub_console_init first.
Change the memory range used for grub_ieee1275_claim and
grub_mm_init_region.
Print an error message if the claim fails.
Include <grub/misc.h>.
2004-10-13 Hollis Blanchard <hollis@penguinppc.org> 2004-10-13 Hollis Blanchard <hollis@penguinppc.org>
* disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate): * disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_iterate):

View file

@ -104,5 +104,7 @@ grub_err_t EXPORT_FUNC(grub_devalias_iterate)
grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath, grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath,
int (*hook) (struct grub_ieee1275_devalias *alias)); int (*hook) (struct grub_ieee1275_devalias *alias));
void EXPORT_FUNC(abort) (void);
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */ #endif /* ! GRUB_IEEE1275_MACHINE_HEADER */

View file

@ -28,6 +28,7 @@
#include <grub/fs.h> #include <grub/fs.h>
#include <grub/setjmp.h> #include <grub/setjmp.h>
#include <grub/env.h> #include <grub/env.h>
#include <grub/misc.h>
void grub_ofdisk_init (void); void grub_ofdisk_init (void);
void grub_console_init (void); void grub_console_init (void);
@ -49,11 +50,25 @@ abort (void)
void void
grub_machine_init (void) grub_machine_init (void)
{ {
if (grub_ieee1275_claim (0x300000, 0x150000, 0, 0) == -1) extern char _start;
abort (); /* Damn, we are in trouble! */ grub_addr_t heap_start;
grub_addr_t heap_len;
/* The memory allocations were copied from yaboot. */ grub_console_init ();
grub_mm_init_region ((void *) 0x300000, 0x150000);
/* Apple OF 1.0.5 reserves 0x4000 bytes for the exception handlers. */
heap_start = 0x4000;
/* Apple OF 3.1.1 reserves an extra 0x1000 bytes below the load address
of an ELF file. */
heap_len = (grub_addr_t) &_start - 0x1000 - heap_start;
if (grub_ieee1275_claim (heap_start, heap_len, 0, 0))
{
grub_printf ("Failed to claim heap at 0x%x, len 0x%x\n", heap_start,
heap_len);
abort ();
}
grub_mm_init_region ((void *) heap_start, heap_len);
/* XXX: Loadable modules are not supported. */ /* XXX: Loadable modules are not supported. */
grub_env_set ("prefix", ""); grub_env_set ("prefix", "");
@ -64,7 +79,6 @@ grub_machine_init (void)
grub_linux_init (); grub_linux_init ();
grub_linux_normal_init (); grub_linux_normal_init ();
grub_ofdisk_init (); grub_ofdisk_init ();
grub_console_init ();
} }
int int