xref: /haiku/src/system/boot/platform/openfirmware/real_time_clock.cpp (revision 884432c2da9fbeb1f5e4e4a48ce271b8ad7ee204)
1 /*
2  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "real_time_clock.h"
8 
9 #include <stdio.h>
10 
11 #include <boot/kernel_args.h>
12 #include <boot/stage2.h>
13 #include <platform/openfirmware/devices.h>
14 #include <platform/openfirmware/openfirmware.h>
15 
16 
17 status_t
18 init_real_time_clock(void)
19 {
20 	// find RTC
21 	int rtcCookie = 0;
22 	if (of_get_next_device(&rtcCookie, 0, "rtc",
23 			gKernelArgs.platform_args.rtc_path,
24 			sizeof(gKernelArgs.platform_args.rtc_path)) != B_OK) {
25 		printf("init_real_time_clock(): Found no RTC device!");
26 		return B_ERROR;
27 	}
28 
29 	return B_OK;
30 }
31 
32