2 * Copyright 2006-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2003, Jeff Ward, jeff@r2d2.stcloudstate.edu. All rights reserved.
5 * Distributed under the terms of the MIT License.
7 #ifndef _KERNEL_REAL_TIME_CLOCK_H
8 #define _KERNEL_REAL_TIME_CLOCK_H
11 #include <KernelExport.h>
19 #define RTC_EPOCH_BASE_YEAR 1970
25 void set_real_time_clock_usecs(bigtime_t currentTime
);
27 status_t
rtc_init(struct kernel_args
*args
);
28 bigtime_t
rtc_boot_time(void);
29 // Returns the time at which the system was booted in microseconds since Jan 1, 1970 UTC.
31 // Both functions use the passed struct tm only partially
32 // (no tm_wday, tm_yday, tm_isdst).
33 uint32
rtc_tm_to_secs(const struct tm
*t
);
34 void rtc_secs_to_tm(uint32 seconds
, struct tm
*t
);
36 uint32
get_timezone_offset(void);
38 bigtime_t
_user_system_time(void);
39 status_t
_user_set_real_time_clock(bigtime_t time
);
40 status_t
_user_set_timezone(int32 timezoneOffset
, const char *name
,
42 status_t
_user_get_timezone(int32
*_timezoneOffset
, char* name
,
44 status_t
_user_set_real_time_clock_is_gmt(bool isGMT
);
45 status_t
_user_get_real_time_clock_is_gmt(bool *_isGMT
);
51 #endif /* _KERNEL_REAL_TIME_CLOCK_H */