From 4fa4224a1d7d63de49cb084c669f599d86574357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 27 Jun 2010 17:56:05 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37280 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/openfirmware/start.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/openfirmware/start.cpp b/src/system/boot/platform/openfirmware/start.cpp index 7d67729b13..15a5ce6cba 100644 --- a/src/system/boot/platform/openfirmware/start.cpp +++ b/src/system/boot/platform/openfirmware/start.cpp @@ -55,6 +55,8 @@ clear_bss(void) static void determine_machine(void) { + gMachine = MACHINE_UNKNOWN; + int root = of_finddevice("/"); char buffer[64]; int length; @@ -64,8 +66,6 @@ determine_machine(void) // ToDo: add more, and be as generic as possible - gMachine = MACHINE_UNKNOWN; - if (!strcasecmp("chrp", buffer)) gMachine = MACHINE_CHRP; else if (!strcasecmp("bootrom", buffer))