]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-01-03 Hollis Blanchard <hollis@penguinppc.org>
authorhollisb <hollisb@localhost>
Mon, 3 Jan 2005 17:44:25 +0000 (17:44 +0000)
committerhollisb <hollisb@localhost>
Mon, 3 Jan 2005 17:44:25 +0000 (17:44 +0000)
* boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
variable.
(find_options): New function.
(cmain): Call find_options.
* include/grub/powerpc/ieee1275/ieee1275.h
(grub_ieee1275_realmode): New extern variable.
* kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
grub_map if grub_ieee1275_realmode is false.

ChangeLog
boot/powerpc/ieee1275/cmain.c
include/grub/powerpc/ieee1275/ieee1275.h
kern/powerpc/ieee1275/openfw.c

index 230814114f50544f0ff5cd9a47543f5b7bbc7832..adb54babac820070db69616ad63a42b32a19862e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-01-03  Hollis Blanchard  <hollis@penguinppc.org>
+
+       * boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
+       variable.
+       (find_options): New function.
+       (cmain): Call find_options.
+       * include/grub/powerpc/ieee1275/ieee1275.h
+       (grub_ieee1275_realmode): New extern variable.
+       * kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
+       grub_map if grub_ieee1275_realmode is false.
+
 2004-12-29  Marco Gerards  <metgerards@student.han.nl>
 
        * normal/cmdline.c (grub_cmdline_get): Redone logic so no empty
index 13c5268d80bdc0b65deb3cfe20d697704f45ebaf..b1ce37462ae295e7eb592ac980d4180e149b271d 100644 (file)
@@ -1,7 +1,7 @@
 /* cmain.c - Startup code for the PowerPC.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+ *  Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -37,8 +37,20 @@ struct module_info
 intptr_t (*grub_ieee1275_entry_fn) (void *);
 
 grub_uint32_t grub_ieee1275_flags;
+int grub_ieee1275_realmode;
 
 \f
+
+static void
+find_options (void)
+{
+  grub_ieee1275_phandle_t options;
+
+  grub_ieee1275_finddevice ("/options", &options);
+  grub_ieee1275_get_property (options, "real-mode?", &grub_ieee1275_realmode,
+                             sizeof (grub_ieee1275_realmode), 0);
+}
+
 /* Setup the argument vector and pass control over to the main
    function.  */
 void
@@ -72,6 +84,8 @@ cmain (uint32_t r3, uint32_t r4 __attribute__((unused)), uint32_t r5)
       grub_ieee1275_entry_fn = (intptr_t (*)(void *)) r5;
     }
 
+  find_options ();
+
   /* If any argument was passed to the kernel (us), they are
      put in the bootargs property of /chosen.  The string can
      be null (just the nul-character), so check that the size
index a169261ce024f6a081a2e6ac98201190dd96013a..bd69d582384370f32b4272c132a8e89cb76e58b0 100644 (file)
@@ -1,7 +1,7 @@
 /* ieee1275.h - Access the Open Firmware client interface.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+ *  Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@ typedef intptr_t grub_ieee1275_phandle_t;
 
 extern intptr_t (*grub_ieee1275_entry_fn) (void *);
 extern grub_uint32_t grub_ieee1275_flags;
+extern int grub_ieee1275_realmode;
 
 /* Old World firmware fails seek when "dev:0" is opened.  */
 #define GRUB_IEEE1275_NO_PARTITION_0 0x1
index ca0891ce19c7bc6c4901dd8794be7ac0b54dd945..60607c5e859e471c20583bab0aae66490cd9219f 100644 (file)
@@ -1,7 +1,7 @@
 /*  openfw.c -- Open firmware support funtions.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ *  Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -189,10 +189,13 @@ grub_claimmap (grub_addr_t addr, grub_size_t size)
 {
   if (grub_ieee1275_claim (addr, size, 0, 0))
     return -1;
-  if (grub_map (addr, addr, size, 0x00))
+
+  if ((! grub_ieee1275_realmode) && grub_map (addr, addr, size, 0x00))
     {
+      grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size);
       grub_ieee1275_release (addr, size);
       return -1;
     }
+
   return 0;
 }