Home
last modified time | relevance | path

Searched refs:year (Results 1 – 25 of 126) sorted by relevance

123456

/linux/arch/alpha/kernel/
H A Drtc.c51 int epoch, year, ctrl; in init_rtc_epoch() local
60 year = CMOS_READ(RTC_YEAR); in init_rtc_epoch()
62 year = bcd2bin(year); in init_rtc_epoch()
66 if (year < 20) { in init_rtc_epoch()
68 } else if (year >= 20 && year < 48) { in init_rtc_epoch()
71 } else if (year >= 48 && year < 70) { in init_rtc_epoch()
77 printk(KERN_INFO "Using epoch %d for rtc year %d\n", epoch, year); in init_rtc_epoch()
94 int year = tm->tm_year; in alpha_rtc_read_time() local
96 if (year >= 100) in alpha_rtc_read_time()
97 year -= 100; in alpha_rtc_read_time()
[all …]
/linux/kernel/time/
H A Dtime_test.c7 * Traditional implementation of leap year evaluation, but note that long
8 * is a signed type and the tests do cover negative year values. So this
11 static bool is_leap(long year) in is_leap()
13 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
19 static int last_day_of_month(long year, int month) in last_day_of_month()
22 return 28 + is_leap(year); in last_day_of_month()
31 static void advance_date(long *year, int *month, int *mday, int *yday) in advance_date()
33 if (*mday != last_day_of_month(*year, *mont in advance_date()
9 is_leap(long year) is_leap() argument
17 last_day_of_month(long year,int month) last_day_of_month() argument
29 advance_date(long * year,int * month,int * mday,int * yday) advance_date() argument
61 long year = 1970 - 80000; time64_to_tm_test_date_range() local
[all...]
H A Dtimeconv.c50 u64 u64tmp, udays, century, year; in time64_to_tm() local
116 year = 100 * century + year_of_century; in time64_to_tm()
130 year = year + is_Jan_or_Feb - 6313183731940000ULL; in time64_to_tm()
136 result->tm_year = (long) (year - 1900); in time64_to_tm()
/linux/drivers/rtc/
H A Drtc-pcf8583.c175 unsigned char ctrl, year[2]; in pcf8583_rtc_read_time() local
178 .nr = sizeof(year), in pcf8583_rtc_read_time()
179 .data = year in pcf8583_rtc_read_time()
202 real_year = year[0]; in pcf8583_rtc_read_time()
217 tm->tm_year = (real_year + year_offset + year[1] * 100) - 1900; in pcf8583_rtc_read_time()
225 unsigned char year[2], chk; in pcf8583_rtc_set_time() local
228 .nr = sizeof(year), in pcf8583_rtc_set_time()
229 .data = year in pcf8583_rtc_set_time()
256 chk -= year[1] + year[0]; in pcf8583_rtc_set_time()
258 year[1] = proper_year / 100; in pcf8583_rtc_set_time()
[all …]
H A Dlib.c30 int rtc_month_days(unsigned int month, unsigned int year) in rtc_month_days() argument
32 return rtc_days_in_month[month] + (is_leap_year(year) && month == 1); in rtc_month_days()
39 int rtc_year_days(unsigned int day, unsigned int month, unsigned int year) in rtc_year_days() argument
41 return rtc_ydays[is_leap_year(year)][month] + day - 1; in rtc_year_days()
57 u32 u32tmp, udays, century, day_of_century, year_of_century, year, in rtc_time64_to_tm() local
119 year = 100 * century + year_of_century; in rtc_time64_to_tm()
134 year = year + is_Jan_or_Feb; in rtc_time64_to_tm()
142 tm->tm_year = (int) (year - 1900); in rtc_time64_to_tm()
H A Drtc-efi.c30 return rtc_year_days(eft->day, eft->month - 1, eft->year); in compute_yday()
39 int ndays = eft->year * (365 % 7) in compute_wday()
40 + (eft->year - 1) / 4 in compute_wday()
41 - (eft->year - 1) / 100 in compute_wday()
42 + (eft->year - 1) / 400 in compute_wday()
55 eft->year = wtime->tm_year + 1900; in convert_to_efi_time()
91 if (eft->year < 1900 || eft->year > 9999) in convert_from_efi_time()
93 wtime->tm_year = eft->year - 1900; in convert_from_efi_time()
162 eft.year, eft.month, eft.day, in efi_procfs()
H A Dtest_rtc_lib.c9 static void advance_date(int *year, int *month, int *mday, int *yday, int *wday) in advance_date() argument
13 if (*mday != rtc_month_days(*month - 1, *year)) { in advance_date()
28 ++*year; in advance_date()
44 int year = 1900; in rtc_time64_to_tm_test_date_range() local
59 year, month, mday, yday, wday, secs + sec_offset in rtc_time64_to_tm_test_date_range()
61 KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG); in rtc_time64_to_tm_test_date_range()
70 advance_date(&year, &month, &mday, &yday, &wday); in rtc_time64_to_tm_test_date_range()
H A Drtc-rtd119x.c49 static inline int rtd119x_rtc_days_in_year(int year) in rtd119x_rtc_days_in_year() argument
51 return 365 + (is_leap_year(year) ? 1 : 0); in rtd119x_rtc_days_in_year()
87 unsigned int year; in rtd119x_rtc_read_time() local
108 year = data->base_year; in rtd119x_rtc_read_time()
109 while (day >= rtd119x_rtc_days_in_year(year)) { in rtd119x_rtc_read_time()
110 day -= rtd119x_rtc_days_in_year(year); in rtd119x_rtc_read_time()
111 year++; in rtd119x_rtc_read_time()
113 tm->tm_year = year - 1900; in rtd119x_rtc_read_time()
117 while (day >= rtc_month_days(tm->tm_mon, year)) { in rtd119x_rtc_read_time()
118 day -= rtc_month_days(tm->tm_mon, year); in rtd119x_rtc_read_time()
H A Drtc-wilco-ec.c55 u8 year; member
80 u8 year; member
112 tm->tm_year = rtc.year + (rtc.century * 100) - 1900; in wilco_ec_rtc_read()
128 int year = tm->tm_year + 1900; in wilco_ec_rtc_write() local
139 rtc.century = bin2bcd(year / 100); in wilco_ec_rtc_write()
140 rtc.year = bin2bcd(year % 100); in wilco_ec_rtc_write()
H A Drtc-aspeed.c24 unsigned int cent, year; in aspeed_rtc_read_time() local
43 year = (reg2 >> 8) & 0x7f; in aspeed_rtc_read_time()
45 tm->tm_year = year + (cent * 100) - 1900; in aspeed_rtc_read_time()
56 int year, cent; in aspeed_rtc_set_time() local
59 year = tm->tm_year % 100; in aspeed_rtc_set_time()
64 reg2 = ((cent & 0x1f) << 16) | ((year & 0x7f) << 8) | in aspeed_rtc_set_time()
H A Drtc-lp8788.c138 int ret, i, year; in lp8788_rtc_set_time() local
140 year = tm->tm_year + 1900 - LP8788_BASE_YEAR; in lp8788_rtc_set_time()
141 if (year < 0) { in lp8788_rtc_set_time()
142 dev_err(lp->dev, "invalid year: %d\n", year); in lp8788_rtc_set_time()
152 data[LPTIME_YEAR] = year; in lp8788_rtc_set_time()
194 int ret, i, year; in lp8788_set_alarm() local
196 year = tm->tm_year + 1900 - LP8788_BASE_YEAR; in lp8788_set_alarm()
197 if (year < 0) { in lp8788_set_alarm()
198 dev_err(lp->dev, "invalid year: %d\n", year); in lp8788_set_alarm()
207 data[LPTIME_YEAR] = year; in lp8788_set_alarm()
H A Drtc-r7301.c151 int year; in rtc7301_get_time() local
174 year = rtc7301_read(priv, RTC7301_1000_YEAR) * 1000 + in rtc7301_get_time()
179 tm->tm_year = year - 1900; in rtc7301_get_time()
185 int year; in rtc7301_write_time() local
209 year = tm->tm_year + 1900; in rtc7301_write_time()
211 rtc7301_write(priv, year % 10, RTC7301_1_YEAR); in rtc7301_write_time()
212 rtc7301_write(priv, (year / 10) % 10, RTC7301_10_YEAR); in rtc7301_write_time()
213 rtc7301_write(priv, (year / 100) % 10, RTC7301_100_YEAR); in rtc7301_write_time()
214 rtc7301_write(priv, year / 1000, RTC7301_1000_YEAR); in rtc7301_write_time()
H A Drtc-m48t59.c105 int year = tm->tm_year - pdata->yy_offset; in m48t59_rtc_set_time() local
108 year + 1900, tm->tm_mon, tm->tm_mday, in m48t59_rtc_set_time()
111 if (year < 0) in m48t59_rtc_set_time()
124 M48T59_WRITE(bin2bcd(year % 100), M48T59_YEAR); in m48t59_rtc_set_time()
126 if (pdata->type == M48T59RTC_TYPE_M48T59 && (year >= 100)) in m48t59_rtc_set_time()
187 int year = tm->tm_year - pdata->yy_offset; in m48t59_rtc_setalarm() local
193 if (year < 0) in m48t59_rtc_setalarm()
227 year + 1900, tm->tm_mon, tm->tm_mday, in m48t59_rtc_setalarm()
H A Drtc-mv.c71 unsigned int year, month, day, hour, minute, second, wday; in mv_rtc_read_time() local
83 year = (rtc_date >> RTC_YEAR_OFFS) & 0xff; in mv_rtc_read_time()
92 tm->tm_year = bcd2bin(year) + 100; in mv_rtc_read_time()
102 unsigned int year, month, day, hour, minute, second, wday; in mv_rtc_read_alarm() local
114 year = (rtc_date >> RTC_YEAR_OFFS) & 0xff; in mv_rtc_read_alarm()
123 alm->time.tm_year = bcd2bin(year) + 100; in mv_rtc_read_alarm()
/linux/arch/m68k/atari/
H A Dtime.c144 int hour, year; in atari_mste_hwclk() local
172 year = t->tm_year - 80; in atari_mste_hwclk()
173 val.year_ones = year % 10; in atari_mste_hwclk()
174 val.year_tens = year / 10; in atari_mste_hwclk()
178 val.year_ones = (year % 4); /* leap year register */ in atari_mste_hwclk()
203 int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0; in atari_tt_hwclk() local
219 year = t->tm_year - atari_rtc_year_offset; in atari_tt_hwclk()
238 year = bin2bcd(year); in atari_tt_hwclk()
271 year = RTC_READ( RTC_YEAR ); in atari_tt_hwclk()
280 RTC_WRITE( RTC_YEAR, year ); in atari_tt_hwclk()
[all …]
/linux/arch/powerpc/platforms/chrp/
H A Dtime.c132 unsigned int year, mon, day, hour, min, sec; in chrp_get_rtc_time() local
140 year = chrp_cmos_clock_read(RTC_YEAR); in chrp_get_rtc_time()
149 year = bcd2bin(year); in chrp_get_rtc_time()
151 if (year < 70) in chrp_get_rtc_time()
152 year += 100; in chrp_get_rtc_time()
158 tm->tm_year = year; in chrp_get_rtc_time()
/linux/fs/isofs/
H A Dutil.c21 int year, month, day, hour, minute, second, tz; in iso_date() local
25 year = (p[0] - '0') * 1000 + in iso_date()
37 year = p[0]; in iso_date()
48 if (year < 0) { in iso_date()
51 ts.tv_sec = mktime64(year+1900, month, day, hour, minute, second); in iso_date()
/linux/arch/mips/dec/
H A Dtime.c24 unsigned int year, mon, day, hour, min, sec, real_year; in read_persistent_clock64() local
35 year = CMOS_READ(RTC_YEAR); in read_persistent_clock64()
52 year = bcd2bin(year); in read_persistent_clock64()
55 year += real_year - 72 + 2000; in read_persistent_clock64()
57 ts->tv_sec = mktime64(year, mon, day, hour, min, sec); in read_persistent_clock64()
/linux/drivers/platform/x86/
H A Dlg-laptop.c777 int year = 2017; in acpi_add() local
811 year = 2021; in acpi_add()
814 year = 2016; in acpi_add()
817 year = 2022; in acpi_add()
821 year = 2016; in acpi_add()
824 year = 2017; in acpi_add()
827 year = 2018; in acpi_add()
830 year = 2019; in acpi_add()
836 year = 2020; in acpi_add()
839 year = 2021; in acpi_add()
[all …]
/linux/arch/mips/sibyte/swarm/
H A Drtc_m41t81.c188 unsigned int year, mon, day, hour, min, sec; in m41t81_get_time() local
204 year = m41t81_read(M41T81REG_YR); in m41t81_get_time()
212 year = bcd2bin(year); in m41t81_get_time()
214 year += 2000; in m41t81_get_time()
216 return mktime64(year, mon, day, hour, min, sec); in m41t81_get_time()
H A Drtc_xicor1241.c169 unsigned int year, mon, day, hour, min, sec, y2k; in xicor_get_time() local
186 year = xicor_read(X1241REG_YR); in xicor_get_time()
195 year = bcd2bin(year); in xicor_get_time()
198 year += (y2k * 100); in xicor_get_time()
200 return mktime64(year, mon, day, hour, min, sec); in xicor_get_time()
/linux/arch/sh/boards/mach-sh03/
H A Drtc.c43 unsigned int year, mon, day, hour, min, sec; in sh03_rtc_gettimeofday() local
53 year = (__raw_readb(RTC_YEA1) & 0xf) + (__raw_readb(RTC_YEA10) & 0xf) * 10 in sh03_rtc_gettimeofday()
57 if (year == 0 || mon < 1 || mon > 12 || day > 31 || day < 1 || in sh03_rtc_gettimeofday()
62 year, mon, day, hour, min, sec); in sh03_rtc_gettimeofday()
84 tm->tm_year = year - 1900; in sh03_rtc_gettimeofday()
/linux/include/linux/
H A Drtc.h21 extern int rtc_month_days(unsigned int month, unsigned int year);
22 extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
224 static inline bool is_leap_year(unsigned int year) in is_leap_year() argument
226 return (!(year % 4) && (year % 100)) || !(year % 400); in is_leap_year()
/linux/crypto/asymmetric_keys/
H A Dx509_cert_parser.c692 unsigned year, mon, day, hour, min, sec, mon_len; in x509_decode_time() local
701 year = DD2bin(p); in x509_decode_time()
702 if (year >= 50) in x509_decode_time()
703 year += 1900; in x509_decode_time()
705 year += 2000; in x509_decode_time()
710 year = DD2bin(p) * 100 + DD2bin(p); in x509_decode_time()
711 if (year >= 1950 && year <= 2049) in x509_decode_time()
726 if (year < 1970 || in x509_decode_time()
732 if (year % 4 == 0) { in x509_decode_time()
734 if (year % 100 == 0) { in x509_decode_time()
[all …]
/linux/net/netfilter/
H A Dxt_time.c106 unsigned int year, i, w = r->dse; in localtime_2()
109 * In each year, a certain number of days-since-the-epoch have passed. in localtime_3()
110 * Find the year that is closest to said days. in localtime_3() local
114 * year == 2009. w will then be 62. in localtime_3()
116 for (i = 0, year = DSE_FIRST; days_since_epoch[i] > w; in localtime_3()
117 ++i, --year) in localtime_3()
123 * By now we have the current year, and the day of the year. in localtime_3()
130 * Consider w=62 (in a non-leap year). Loop will abort on in localtime_3()
137 if (is_leap_year(year)) { in localtime_3()
[all...]

123456