From 2e080fb4d6e59c04ed2956573804ab1e00e810bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 9 Nov 2004 12:51:59 +0000 Subject: [PATCH] switch to struct real_time_data, renamed function and variables git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9881 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/os/time.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/kernel/libroot/os/time.c b/src/kernel/libroot/os/time.c index 8a5d21abcd..524311d056 100644 --- a/src/kernel/libroot/os/time.c +++ b/src/kernel/libroot/os/time.c @@ -7,29 +7,29 @@ #include #include #include "syscalls.h" +#include "real_time_data.h" static volatile bigtime_t *sBootTime = NULL; - -status_t -setup_rtc_area() +static status_t +setup_rtc_boottime() { - area_id rtcArea = find_area("rtc_region"); + area_id dataArea = find_area("real time data userland"); area_info info; status_t err; - if (rtcArea < 0) { - printf("setup_rtc_area: error finding rtc_region %s\n", - strerror(rtcArea)); - return rtcArea; + if (dataArea < 0) { + printf("setup_rtc_boottime: error finding real time data area %s\n", + strerror(dataArea)); + return dataArea; } - err = get_area_info(rtcArea, &info); + err = get_area_info(dataArea, &info); if (err < B_OK) { - printf("setup_rtc_area: error getting rtc_region info\n"); + printf("setup_rtc_boottime: error getting real time data info\n"); return err; } - sBootTime = (bigtime_t *)info.address; + sBootTime = &((struct real_time_data *)info.address)->boot_time; return B_OK; } @@ -37,7 +37,7 @@ setup_rtc_area() uint32 real_time_clock(void) { - if (!sBootTime && (setup_rtc_area()!=B_OK)) + if (!sBootTime && (setup_rtc_boottime()!=B_OK)) return 0; return (*sBootTime + system_time()) / 1000000; } @@ -53,7 +53,7 @@ set_real_time_clock(uint32 secs) bigtime_t real_time_clock_usecs(void) { - if (!sBootTime && (setup_rtc_area() != B_OK)) + if (!sBootTime && (setup_rtc_boottime() != B_OK)) return 0; return *sBootTime + system_time(); }