2006-03-14 17:29:56 +03:00
|
|
|
/*
|
2007-10-14 21:27:44 +04:00
|
|
|
* Copyright 2006-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
2006-03-14 17:29:56 +03:00
|
|
|
* Copyright 2003, Jeff Ward, jeff@r2d2.stcloudstate.edu. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-10-24 14:21:10 +04:00
|
|
|
#ifndef _KERNEL_REAL_TIME_CLOCK_H
|
|
|
|
#define _KERNEL_REAL_TIME_CLOCK_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <KernelExport.h>
|
|
|
|
|
2006-01-03 20:26:37 +03:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
2010-08-04 21:11:47 +04:00
|
|
|
struct kernel_args;
|
|
|
|
|
|
|
|
|
2007-10-14 21:27:44 +04:00
|
|
|
#define RTC_EPOCH_BASE_YEAR 1970
|
2003-10-24 14:21:10 +04:00
|
|
|
|
2003-10-24 15:58:21 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2003-10-24 14:21:10 +04:00
|
|
|
|
2010-08-04 21:11:47 +04:00
|
|
|
status_t rtc_init(struct kernel_args *args);
|
2004-11-29 02:23:48 +03:00
|
|
|
bigtime_t rtc_boot_time(void);
|
|
|
|
// Returns the time at which the system was booted in microseconds since Jan 1, 1970 UTC.
|
2003-10-24 15:58:21 +04:00
|
|
|
|
2006-01-03 20:26:37 +03:00
|
|
|
// Both functions use the passed struct tm only partially
|
|
|
|
// (no tm_wday, tm_yday, tm_isdst).
|
|
|
|
uint32 rtc_tm_to_secs(const struct tm *t);
|
|
|
|
void rtc_secs_to_tm(uint32 seconds, struct tm *t);
|
|
|
|
|
2010-08-05 01:57:44 +04:00
|
|
|
uint32 get_timezone_offset(void);
|
2010-08-04 21:11:47 +04:00
|
|
|
|
2004-11-26 18:00:27 +03:00
|
|
|
bigtime_t _user_system_time(void);
|
2004-11-05 19:06:28 +03:00
|
|
|
status_t _user_set_real_time_clock(uint32 time);
|
2010-08-04 03:02:57 +04:00
|
|
|
status_t _user_set_timezone(int32 timezoneOffset);
|
|
|
|
status_t _user_get_timezone(int32 *_timezoneOffset);
|
2010-08-03 21:47:26 +04:00
|
|
|
status_t _user_set_real_time_clock_is_gmt(bool isGMT);
|
|
|
|
status_t _user_get_real_time_clock_is_gmt(bool *_isGMT);
|
2003-10-28 16:30:10 +03:00
|
|
|
|
2003-10-24 15:58:21 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2003-10-24 14:21:10 +04:00
|
|
|
|
|
|
|
#endif /* _KERNEL_REAL_TIME_CLOCK_H */
|