[haiku-commits] r37280 - haiku/trunk/src/system/boot/platform/openfirmware

  • From: andreas.faerber@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 27 Jun 2010 19:56:05 +0200 (CEST)

Author: andreasf
Date: 2010-06-27 19:56:05 +0200 (Sun, 27 Jun 2010)
New Revision: 37280
Changeset: http://dev.haiku-os.org/changeset/37280/haiku
Ticket: http://dev.haiku-os.org/ticket/6123

Modified:
   haiku/trunk/src/system/boot/platform/openfirmware/start.cpp
Log:
OpenFirmware: Assure machine type is initialized

On QEMU's emulation of a PowerPC Old World Mac (g3beige), determine_machine()
returns without setting the machine type to unknown, since the root device
does not provide a device_type property.

Move the variable assignment up a few lines to remedy this.

Closes ticket #6123.


Modified: haiku/trunk/src/system/boot/platform/openfirmware/start.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/openfirmware/start.cpp 2010-06-27 
15:17:59 UTC (rev 37279)
+++ haiku/trunk/src/system/boot/platform/openfirmware/start.cpp 2010-06-27 
17:56:05 UTC (rev 37280)
@@ -55,6 +55,8 @@
 static void 
 determine_machine(void)
 {
+       gMachine = MACHINE_UNKNOWN;
+
        int root = of_finddevice("/");
        char buffer[64];
        int length;
@@ -64,8 +66,6 @@
 
        // ToDo: add more, and be as generic as possible
 
-       gMachine = MACHINE_UNKNOWN;
-
        if (!strcasecmp("chrp", buffer))
                gMachine = MACHINE_CHRP;
        else if (!strcasecmp("bootrom", buffer))


Other related posts:

  • » [haiku-commits] r37280 - haiku/trunk/src/system/boot/platform/openfirmware - andreas . faerber