/linux/arch/alpha/kernel/ |
A D | rtc.c | 51 int epoch, year, ctrl; in init_rtc_epoch() local 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() 89 int year = tm->tm_year; in alpha_rtc_read_time() local 91 if (year >= 100) in alpha_rtc_read_time() 92 year -= 100; in alpha_rtc_read_time() 95 if (year <= 69) in alpha_rtc_read_time() 96 year += 100; in alpha_rtc_read_time() [all …]
|
/linux/kernel/time/ |
A D | time_test.c | 9 static bool is_leap(long year) in is_leap() argument 11 return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); in is_leap() 17 static int last_day_of_month(long year, int month) in last_day_of_month() argument 20 return 28 + is_leap(year); in last_day_of_month() 29 static void advance_date(long *year, int *month, int *mday, int *yday) in advance_date() argument 31 if (*mday != last_day_of_month(*year, *month)) { in advance_date() 46 ++*year; in advance_date() 61 long year = 1970 - 80000; in time64_to_tm_test_date_range() local 77 year, month, mdday, yday, days in time64_to_tm_test_date_range() 79 KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG); in time64_to_tm_test_date_range() [all …]
|
A D | timeconv.c | 50 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/ |
A D | rtc-pcf8583.c | 175 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() 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() 259 year[0] = proper_year % 100; in pcf8583_rtc_set_time() [all …]
|
A D | lib_test.c | 9 static void advance_date(int *year, int *month, int *mday, int *yday) in advance_date() argument 11 if (*mday != rtc_month_days(*month - 1, *year)) { in advance_date() 26 ++*year; in advance_date() 42 int year = 1970; in rtc_time64_to_tm_test_date_range() local 58 year, month, mday, yday, days in rtc_time64_to_tm_test_date_range() 60 KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG); in rtc_time64_to_tm_test_date_range() 65 advance_date(&year, &month, &mday, &yday); in rtc_time64_to_tm_test_date_range()
|
A D | lib.c | 30 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() 58 u32 u32tmp, udays, century, day_of_century, year_of_century, year, in rtc_time64_to_tm() local 107 year = 100 * century + year_of_century; in rtc_time64_to_tm() 122 year = year + is_Jan_or_Feb; in rtc_time64_to_tm() 130 tm->tm_year = (int) (year - 1900); in rtc_time64_to_tm()
|
A D | rtc-efi.c | 30 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() 207 eft.year, eft.month, eft.day, in efi_procfs() 223 alm.year, alm.month, alm.day, in efi_procfs()
|
A D | rtc-rtd119x.c | 49 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()
|
A D | rtc-wilco-ec.c | 55 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()
|
A D | rtc-lp8788.c | 138 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()
|
A D | rtc-aspeed.c | 25 unsigned int cent, year; in aspeed_rtc_read_time() local 44 year = (reg2 >> 8) & 0x7f; in aspeed_rtc_read_time() 46 tm->tm_year = year + (cent * 100) - 1900; in aspeed_rtc_read_time() 57 int year, cent; in aspeed_rtc_set_time() local 60 year = tm->tm_year % 100; in aspeed_rtc_set_time() 65 reg2 = ((cent & 0x1f) << 16) | ((year & 0x7f) << 8) | in aspeed_rtc_set_time()
|
/linux/arch/mips/include/asm/mach-rm/ |
A D | mc146818rtc.h | 14 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) argument 16 #define mc146818_decode_year(year) ((year) + 1980) argument
|
/linux/arch/m68k/atari/ |
A D | time.c | 142 int hour, year; in atari_mste_hwclk() local 170 year = t->tm_year - 80; in atari_mste_hwclk() 171 val.year_ones = year % 10; in atari_mste_hwclk() 172 val.year_tens = year / 10; in atari_mste_hwclk() 201 int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0; in atari_tt_hwclk() local 217 year = t->tm_year - atari_rtc_year_offset; in atari_tt_hwclk() 236 year = bin2bcd(year); in atari_tt_hwclk() 269 year = RTC_READ( RTC_YEAR ); in atari_tt_hwclk() 278 RTC_WRITE( RTC_YEAR, year ); in atari_tt_hwclk() 298 year = bcd2bin(year); in atari_tt_hwclk() [all …]
|
/linux/arch/mips/include/asm/ |
A D | mc146818-time.h | 91 unsigned int year, mon, day, hour, min, sec; in mc146818_get_cmos_time() local 102 year = CMOS_READ(RTC_YEAR); in mc146818_get_cmos_time() 111 year = bcd2bin(year); in mc146818_get_cmos_time() 114 year = mc146818_decode_year(year); in mc146818_get_cmos_time() 116 return mktime64(year, mon, day, hour, min, sec); in mc146818_get_cmos_time()
|
/linux/Documentation/RCU/ |
A D | RTFP.txt | 244 ,year="1982" 359 ,year="1989" 370 ,year="1990" 405 ,year="1992" 417 ,year="1993" 460 ,year="1995" 476 ,year="1996" 492 ,year="1995" 510 ,year="1997" 804 ,year=2002 [all …]
|
/linux/arch/powerpc/platforms/chrp/ |
A D | time.c | 134 unsigned int year, mon, day, hour, min, sec; in chrp_get_rtc_time() local 142 year = chrp_cmos_clock_read(RTC_YEAR); in chrp_get_rtc_time() 151 year = bcd2bin(year); in chrp_get_rtc_time() 153 if (year < 70) in chrp_get_rtc_time() 154 year += 100; in chrp_get_rtc_time() 160 tm->tm_year = year; in chrp_get_rtc_time()
|
/linux/arch/x86/kernel/ |
A D | rtc.c | 65 unsigned int status, year, mon, day, hour, min, sec, century = 0; in mach_get_cmos_time() local 93 year = CMOS_READ(RTC_YEAR); in mach_get_cmos_time() 112 year = bcd2bin(year); in mach_get_cmos_time() 117 year += century * 100; in mach_get_cmos_time() 119 year += CMOS_YEARS_OFFS; in mach_get_cmos_time() 121 now->tv_sec = mktime64(year, mon, day, hour, min, sec); in mach_get_cmos_time()
|
/linux/arch/mips/dec/ |
A D | time.c | 24 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/arch/mips/include/asm/mach-malta/ |
A D | mc146818rtc.h | 34 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) argument
|
/linux/arch/mips/include/asm/mach-generic/ |
A D | mc146818rtc.h | 33 #define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) argument
|
/linux/fs/isofs/ |
A D | util.c | 21 int year, month, day, hour, minute, second, tz; in iso_date() local 24 year = p[0]; in iso_date() 33 if (year < 0) { in iso_date() 36 crtime = mktime64(year+1900, month, day, hour, minute, second); in iso_date()
|
/linux/arch/mips/sibyte/swarm/ |
A D | rtc_m41t81.c | 188 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()
|
A D | rtc_xicor1241.c | 169 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/drivers/platform/x86/ |
A D | lg-laptop.c | 638 int year = 2017; in acpi_add() local 663 year = 2021; in acpi_add() 666 year = 2016; in acpi_add() 669 year = 2022; in acpi_add() 673 year = 2016; in acpi_add() 676 year = 2017; in acpi_add() 679 year = 2018; in acpi_add() 682 year = 2019; in acpi_add() 688 year = 2020; in acpi_add() 691 year = 2021; in acpi_add() [all …]
|
/linux/fs/udf/ |
A D | udftime.c | 47 u16 year = le16_to_cpu(src.year); in udf_disk_stamp_to_time() local 60 dest->tv_sec = mktime64(year, src.month, src.day, src.hour, src.minute, in udf_disk_stamp_to_time() 85 dest->year = cpu_to_le16(tm.tm_year + 1900); in udf_time_to_disk_stamp()
|