xref: /haiku/headers/private/kernel/arch/real_time_clock.h (revision 09bb4e9ac5dc193f63b02b33e88085f22d8719ab)
1 /*
2  * Copyright 2005, Axel Dörfler, axeld@pinc-software.de
3  * Copyright 2003, Jeff Ward, jeff@r2d2.stcloudstate.edu. All rights reserved.
4  *
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef KERNEL_ARCH_REAL_TIME_CLOCK_H
8 #define KERNEL_ARCH_REAL_TIME_CLOCK_H
9 
10 
11 #include <kernel.h>
12 
13 struct kernel_args;
14 struct real_time_data;
15 
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 status_t arch_rtc_init(struct kernel_args *args, struct real_time_data *data);
22 
23 void arch_rtc_set_hw_time(uint32 seconds);
24 	// Set HW clock to 'seconds' since 1/1/1970
25 uint32 arch_rtc_get_hw_time(void);
26 	// Returns number of seconds since 1/1/1970 as stored in HW
27 
28 void arch_rtc_set_system_time_offset(struct real_time_data *data,
29 	bigtime_t offset);
30 	// Set the system time offset in data.
31 bigtime_t arch_rtc_get_system_time_offset(struct real_time_data *data);
32 	// Return the system time offset as stored in data.
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif	/* KERNEL_ARCH_REAL_TIME_CLOCK_H */
39