device in the Open Firmware implementation of boot loader and pass its path to the kernel, where it's opened and used for getting/setting the real time. The expensive atomic_*64() on PPC 32-bit make things a bit more complicated. Moreover, missing 64 bit multiplication and division instructions won't really allow system_time() to be anywhere near as fast as on x86. :-/ git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15837 a95241bf-73f2-0310-859d-f6bbb57e9c96
31 lines
664 B
C++
31 lines
664 B
C++
/*
|
|
* Copyright 2006, Ingo Weinhold <[email protected]>.
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
*/
|
|
|
|
#include "real_time_clock.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <boot/kernel_args.h>
|
|
#include <boot/stage2.h>
|
|
#include <platform/openfirmware/openfirmware.h>
|
|
|
|
#include "devices.h"
|
|
|
|
status_t
|
|
init_real_time_clock(void)
|
|
{
|
|
// find RTC
|
|
int rtcCookie = 0;
|
|
if (platform_get_next_device(&rtcCookie, 0, "rtc",
|
|
gKernelArgs.platform_args.rtc_path,
|
|
sizeof(gKernelArgs.platform_args.rtc_path)) != B_OK) {
|
|
printf("init_real_time_clock(): Found no RTC device!");
|
|
return B_ERROR;
|
|
}
|
|
|
|
return B_OK;
|
|
}
|
|
|