From 9ffc3c3d8ae7b5f34cb1ee8dc58ec54edb04d7cf Mon Sep 17 00:00:00 2001 From: "Ithamar R. Adema" Date: Thu, 15 Nov 2012 18:41:57 +0100 Subject: [PATCH] ARM/libroot: stub out the missing functions for now This will get libroot.so to build, which should give us much more compilation coverage for ARM now too. Will have to go through all the libroot code with a tooth comb anyway once userland comes up... (Will consider replacing the glibc mess with bsd for all non gcc2 platforms) --- src/system/libroot/os/arch/arm/Jamfile | 1 + src/system/libroot/os/arch/arm/stack_frame.c | 27 ++++++++++++++++++ src/system/libroot/os/arch/arm/system_time.c | 30 +++++++++++++++++--- 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/system/libroot/os/arch/arm/stack_frame.c diff --git a/src/system/libroot/os/arch/arm/Jamfile b/src/system/libroot/os/arch/arm/Jamfile index 52b5f241fb..2ebb171b6d 100644 --- a/src/system/libroot/os/arch/arm/Jamfile +++ b/src/system/libroot/os/arch/arm/Jamfile @@ -9,6 +9,7 @@ MergeObject os_arch_$(TARGET_ARCH).o : atomic.S byteorder.S system_time.c + stack_frame.c thread.c time.c tls.c diff --git a/src/system/libroot/os/arch/arm/stack_frame.c b/src/system/libroot/os/arch/arm/stack_frame.c new file mode 100644 index 0000000000..30223cbcea --- /dev/null +++ b/src/system/libroot/os/arch/arm/stack_frame.c @@ -0,0 +1,27 @@ +/* + * Copyright 2012, Haiku, Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * François Revol + */ + +#include + +#include + + +void* +get_stack_frame(void) +{ + // TODO: Implement! + return NULL; +} + + +void* +__arch_get_caller(void) +{ + // TODO: Implement! + return NULL; +} diff --git a/src/system/libroot/os/arch/arm/system_time.c b/src/system/libroot/os/arch/arm/system_time.c index 7fd1fd4dd1..6514ae92e4 100644 --- a/src/system/libroot/os/arch/arm/system_time.c +++ b/src/system/libroot/os/arch/arm/system_time.c @@ -1,6 +1,9 @@ /* - * Copyright 2006, Ingo Weinhold . - * All rights reserved. Distributed under the terms of the MIT License. + * Copyright 2012, Haiku, Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * François Revol */ #include @@ -9,10 +12,29 @@ #include #include +static vint32 *sConversionFactor; + +void +__arm_setup_system_time(vint32 *cvFactor) +{ + sConversionFactor = cvFactor; +} + + +//XXX: this is a hack +// remove me when platform code works +static int64 +__arm_get_time_base(void) +{ + static uint64 time_dilation_field = 0; + return time_dilation_field++; +} bigtime_t system_time(void) { -#warning ARM:WRITEME - return 0; + uint64 timeBase = __arm_get_time_base(); + + uint32 cv = *sConversionFactor; + return (timeBase >> 32) * cv + (((timeBase & 0xffffffff) * cv) >> 32); }