Author: kallisti5 Date: 2011-07-26 18:42:14 +0200 (Tue, 26 Jul 2011) New Revision: 42498 Changeset: https://dev.haiku-os.org/changeset/42498 Added: haiku/trunk/src/system/boot/platform/openfirmware/support.cpp haiku/trunk/src/system/boot/platform/openfirmware/support.h Removed: haiku/trunk/src/system/boot/platform/openfirmware/of_support.cpp haiku/trunk/src/system/boot/platform/openfirmware/of_support.h Modified: haiku/trunk/headers/private/kernel/platform/openfirmware/openfirmware.h haiku/trunk/src/system/boot/platform/openfirmware/Jamfile haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp Log: * Rename of_region type template as per Axel * Rename of_support.h/cpp back to support.cpp as per Axel Modified: haiku/trunk/headers/private/kernel/platform/openfirmware/openfirmware.h =================================================================== --- haiku/trunk/headers/private/kernel/platform/openfirmware/openfirmware.h 2011-07-26 15:09:18 UTC (rev 42497) +++ haiku/trunk/headers/private/kernel/platform/openfirmware/openfirmware.h 2011-07-26 16:42:14 UTC (rev 42498) @@ -16,9 +16,9 @@ extern int gChosen; -template<typename AddressSize> +template<typename AddressType> struct of_region { - AddressSize base; + AddressType base; uint32 size; }; Modified: haiku/trunk/src/system/boot/platform/openfirmware/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/Jamfile 2011-07-26 15:09:18 UTC (rev 42497) +++ haiku/trunk/src/system/boot/platform/openfirmware/Jamfile 2011-07-26 16:42:14 UTC (rev 42498) @@ -17,7 +17,7 @@ network.cpp real_time_clock.cpp start.cpp - of_support.cpp + support.cpp video.cpp openfirmware.cpp Modified: haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2011-07-26 15:09:18 UTC (rev 42497) +++ haiku/trunk/src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp 2011-07-26 16:42:14 UTC (rev 42498) @@ -22,7 +22,7 @@ #include <arch_mmu.h> #include <kernel.h> -#include "of_support.h" +#include "support.h" // set protection to WIMGNPP: -----PP Copied: haiku/trunk/src/system/boot/platform/openfirmware/support.cpp (from rev 42497, haiku/trunk/src/system/boot/platform/openfirmware/of_support.cpp) =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/support.cpp (rev 0) +++ haiku/trunk/src/system/boot/platform/openfirmware/support.cpp 2011-07-26 16:42:14 UTC (rev 42498) @@ -0,0 +1,49 @@ +/* + * Copyright 2005, Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>. + * Copyright 2006-2011, Haiku, Inc. All Rights Reserved. + * All rights reserved. Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish@xxxxxxxxxxxxxxx + * Alexander von Gluck, kallisti5@xxxxxxxxxxx + */ + + +#include "support.h" +#include <platform/openfirmware/openfirmware.h> + + +bigtime_t +system_time(void) +{ + int result = of_milliseconds(); + return (result == OF_FAILED ? 0 : bigtime_t(result) * 1000); +} + + +/** given the package provided, get the number of cells ++ in the reg property ++ */ + +int32 +of_address_cells(int package) { + uint32 address_cells; + if (of_getprop(package, "#address-cells", + &address_cells, sizeof(address_cells)) == OF_FAILED) + return OF_FAILED; + + return address_cells; +} + + +int32 +of_size_cells(int package) { + uint32 size_cells; + if (of_getprop(package, "#size-cells", + &size_cells, sizeof(size_cells)) == OF_FAILED) + return OF_FAILED; + + return size_cells; +} + + Copied: haiku/trunk/src/system/boot/platform/openfirmware/support.h (from rev 42497, haiku/trunk/src/system/boot/platform/openfirmware/of_support.h) =================================================================== --- haiku/trunk/src/system/boot/platform/openfirmware/support.h (rev 0) +++ haiku/trunk/src/system/boot/platform/openfirmware/support.h 2011-07-26 16:42:14 UTC (rev 42498) @@ -0,0 +1,19 @@ +/* + * Copyright 2006-2011, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexander von Gluck, kallisti5@xxxxxxxxxxx + */ +#ifndef SUPPORT_H +#define SUPPORT_H + + +#include <OS.h> + + +bigtime_t system_time(void); +int32 of_address_cells(int package); +int32 of_size_cells(int package); + +#endif