// SPDX-License-Identifier: GPL-2.0 /* * rtc and date/time utility functions * * Copyright (C) 2005-06 Tower Technologies * Author: Alessandro Zummo <[email protected]> * * based on arch/arm/common/rtctime.c and other bits * * Author: Cassio Neri <[email protected]> (rtc_time64_to_tm) */ #include <linux/export.h> #include <linux/rtc.h> static const unsigned char rtc_days_in_month[] = …; static const unsigned short rtc_ydays[2][13] = …; /* * The number of days in the month. */ int rtc_month_days(unsigned int month, unsigned int year) { … } EXPORT_SYMBOL(…); /* * The number of days since January 1. (0 to 365) */ int rtc_year_days(unsigned int day, unsigned int month, unsigned int year) { … } EXPORT_SYMBOL(…); /** * rtc_time64_to_tm - converts time64_t to rtc_time. * * @time: The number of seconds since 01-01-1970 00:00:00. * (Must be positive.) * @tm: Pointer to the struct rtc_time. */ void rtc_time64_to_tm(time64_t time, struct rtc_time *tm) { … } EXPORT_SYMBOL(…); /* * Does the rtc_time represent a valid date/time? */ int rtc_valid_tm(struct rtc_time *tm) { … } EXPORT_SYMBOL(…); /* * rtc_tm_to_time64 - Converts rtc_time to time64_t. * Convert Gregorian date to seconds since 01-01-1970 00:00:00. */ time64_t rtc_tm_to_time64(struct rtc_time *tm) { … } EXPORT_SYMBOL(…); /* * Convert rtc_time to ktime */ ktime_t rtc_tm_to_ktime(struct rtc_time tm) { … } EXPORT_SYMBOL_GPL(…); /* * Convert ktime to rtc_time */ struct rtc_time rtc_ktime_to_tm(ktime_t kt) { … } EXPORT_SYMBOL_GPL(…);