/openbmc/linux/kernel/time/ |
H A D | time_test.c | 7 * Traditional implementation of leap year evaluation. 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() [all …]
|
H A D | timeconv.c | 50 u64 u64tmp, udays, century, year; in time64_to_tm() local 80 * (fictitious) calendar where the year starts in March, month = 2 in time64_to_tm() 82 * mathematically convenient because the day of the year does not in time64_to_tm() 83 * depend on whether the year is leap or not. For instance: in time64_to_tm() 85 * March 1st 0-th day of the year; in time64_to_tm() 87 * April 1st 31-st day of the year; in time64_to_tm() 89 * January 1st 306-th day of the year; (Important!) in time64_to_tm() 91 * February 28th 364-th day of the year; in time64_to_tm() 92 * February 29th 365-th day of the year (if it exists). in time64_to_tm() 116 year = 100 * century + year_of_century; in time64_to_tm() [all …]
|
/openbmc/u-boot/drivers/rtc/ |
H A D | rtc-lib.c | 9 * - The year field takes the actual value, not year - 1900. 26 static int rtc_month_days(unsigned int month, unsigned int year) in rtc_month_days() argument 28 return rtc_days_in_month[month] + (is_leap_year(year) && month == 1); in rtc_month_days() 36 * But in U-Boot January is month 1 and we do not subtract 1900 from the year. 40 unsigned int month, year, secs; in rtc_to_tm() local 48 year = 1970 + days / 365; in rtc_to_tm() 49 days -= (year - 1970) * 365 in rtc_to_tm() 50 + LEAPS_THRU_END_OF(year - 1) in rtc_to_tm() 53 year -= 1; in rtc_to_tm() 54 days += 365 + is_leap_year(year); in rtc_to_tm() [all …]
|
H A D | date.c | 19 #define leapyear(year) ((year) % 4 == 0) argument 40 /* Number of leap corrections to apply up to end of last year */ in rtc_calc_weekday() 44 * This year is a leap year if it is divisible by 4 except when it is in rtc_calc_weekday() 47 * e.g. 1904 was a leap year, 1900 was not, 1996 is, and 2000 is. in rtc_calc_weekday() 52 /* We are past Feb. 29 in a leap year */ in rtc_calc_weekday() 68 * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. 73 * -year / 100 + year / 400 terms, and add 10.] 84 int year = tm->tm_year; in rtc_mktime() local 90 year -= 1; in rtc_mktime() 93 days = (unsigned long)(year / 4 - year / 100 + year / 400 + in rtc_mktime() [all …]
|
H A D | s3c24x0_rtc.c | 46 uchar sec, min, hour, mday, wday, mon, year; in rtc_get() local 61 year = readb(&rtc->bcdyear); in rtc_get() 77 printf("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " in rtc_get() 79 year, mon, mday, wday, hour, min, sec); in rtc_get() 80 printf("Alarms: %02x: year: %02x month: %02x date: %02x hour: " in rtc_get() 90 tmp->tm_year = bcd2bin(year); in rtc_get() 110 uchar sec, min, hour, mday, wday, mon, year; in rtc_set() local 117 year = bin2bcd(tmp->tm_year % 100); in rtc_set() 135 writeb(year, &rtc->bcdyear); in rtc_set()
|
H A D | ds174x.c | 50 uchar mday, wday, mon, year; in rtc_get() local 66 year = rtc_read( RTC_YEAR ); in rtc_get() 73 printf( "Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " in rtc_get() 75 year, mon_cent, mday, wday, in rtc_get() 85 /* glue year from century and year in century */ in rtc_get() 86 tmp->tm_year = bcd2bin( year ) + in rtc_get() 119 /* break year up into century and year in century */ in rtc_set()
|
H A D | davinci.c | 15 unsigned long sec, min, hour, mday, wday, mon_cent, year; in rtc_get() local 32 year = readl(&rtc->year); in rtc_get() 34 debug("Get RTC year: %02lx mon/cent: %02lx mday: %02lx wday: %02lx " in rtc_get() 36 year, mon_cent, mday, wday, in rtc_get() 44 tmp->tm_year = bcd2bin(year) + 2000; in rtc_get() 63 writel(bin2bcd(tmp->tm_year % 100), &rtc->year); in rtc_set()
|
/openbmc/linux/arch/alpha/kernel/ |
H A D | rtc.c | 51 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() 64 /* PC-like is standard; used for year >= 70 */ 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() [all …]
|
/openbmc/linux/Documentation/RCU/ |
H A D | RTFP.txt | 86 reader at a time. The following year, this same group of researchers 102 The year 2000 saw an email exchange that would likely have 106 abundance of RCU patches was presented the following year [McKenney02a], 107 and use of RCU in dcache was first described that same year [Linder02a]. 137 Later that year saw a paper describing an RCU implementation 224 ,Year="1980" 244 ,year="1982" 278 ,Year="1984" 314 ,Year="1987" 339 ,year = {1988} [all …]
|
/openbmc/linux/drivers/rtc/ |
H 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 71 * (fictitious) calendar where the year starts in March, month = 2 in rtc_time64_to_tm() 73 * mathematically convenient because the day of the year does not in rtc_time64_to_tm() 74 * depend on whether the year is leap or not. For instance: in rtc_time64_to_tm() 76 * March 1st 0-th day of the year; in rtc_time64_to_tm() 78 * April 1st 31-st day of the year; in rtc_time64_to_tm() [all …]
|
H 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() 205 * The RTC year holds the LSB two bits of the current in pcf8583_rtc_read_time() 206 * year, which should reflect the LSB two bits of the in pcf8583_rtc_read_time() 207 * CMOS copy of the year. Any difference indicates in pcf8583_rtc_read_time() 213 * RTC year wrapped. Adjust it appropriately. 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 [all …]
|
H A D | rtc-wilco-ec.c | 43 * @year: Year value (full year % 100) 44 * @century: Century value (full year / 100) 55 u8 year; member 64 * @century: Century value (full year / 100) 65 * @year: Year value (full year % 100) 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 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()
|
H A D | rtc-efi.c | 24 * returns day of the year [0-365] 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() 95 /* day in the year [1-365]*/ in convert_from_efi_time() [all …]
|
H 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()
|
H 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()
|
H A D | rtc-ac100.c | 61 * The year parameter passed to the driver is usually an offset relative to 62 * the year 1900. This macro is used to convert this offset to another one 63 * relative to the minimum year allowed by the hardware. 65 * The year range is 1970 - 2069. This range is selected to match Allwinner's 411 int year; in ac100_rtc_set_time() local 414 /* our RTC has a limited year range... */ in ac100_rtc_set_time() 415 year = rtc_tm->tm_year - AC100_YEAR_OFF; in ac100_rtc_set_time() 416 if (year < 0 || year > (AC100_YEAR_MAX - 1900)) { in ac100_rtc_set_time() 417 dev_err(dev, "rtc only supports year in range %d - %d\n", in ac100_rtc_set_time() 429 reg[6] = bin2bcd(year) & AC100_RTC_YEA_MASK; in ac100_rtc_set_time() [all …]
|
/openbmc/linux/arch/mips/include/asm/mach-rm/ |
H 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
|
/openbmc/linux/arch/m68k/atari/ |
H 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() 176 val.year_ones = (year % 4); /* leap year register */ 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() [all …]
|
/openbmc/bmcweb/redfish-core/schema/dmtf/json-schema/ |
H A D | Schedule.v1_2_5.json | 35 "description": "Months of the year.", 55 "Every": "Every month of the year.", 67 …"Every": "This value indicates that every month of the year has been selected. When used in array… 69 "longDescription": "Months of the year.", 99 …scheduled occurrences are enabled, for enabled days of week and months of year. If the array cont… 106 … occurrences are enabled, for enabled days of the month and months of the year. If not present, a… 135 …"description": "The months of the year when scheduled occurrences are enabled. If not present, al… 146 …nths of the year when scheduled occurrences are enabled, for enabled days of week and days of mont…
|
/openbmc/bmcweb/redfish-core/include/utils/extern/ |
H A D | date.h | 228 class year; variable 248 CONSTCD11 year_month operator/(const year& y, const month& m) NOEXCEPT; 249 CONSTCD11 year_month operator/(const year& y, int m) NOEXCEPT; 274 CONSTCD11 year_month_day operator/(const year& y, const month_day& md) NOEXCEPT; 276 CONSTCD11 year_month_day operator/(const month_day& md, const year& y) NOEXCEPT; 282 year_month_day_last operator/(const year& y, const month_day_last& mdl) NOEXCEPT; 286 year_month_day_last operator/(const month_day_last& mdl, const year& y) NOEXCEPT; 296 operator/(const year& y, const month_weekday& mwd) NOEXCEPT; 304 operator/(const month_weekday& mwd, const year& y) NOEXCEPT; 316 operator/(const year& y, const month_weekday_last& mwdl) NOEXCEPT; [all …]
|
/openbmc/linux/arch/mips/sibyte/swarm/ |
H A D | rtc_xicor1241.c | 49 #define X1241REG_YR 0x35 /* Year */ 51 #define X1241REG_Y2K 0x37 /* Year 2K */ 137 /* year is split */ in xicor_set_time() 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()
|
/openbmc/pldm/libpldmresponder/test/ |
H A D | libpldmresponder_bios_test.cpp | 36 uint16_t year = 0; in TEST() local 38 epochToBCDTime(epochTime, seconds, minutes, hours, day, month, year); in TEST() 45 ASSERT_EQ(0x2019, year); in TEST() 57 uint16_t year = 2019; in TEST() local 60 timeSec = timeToEpoch(sec, min, hours, day, month, year); in TEST()
|
/openbmc/linux/arch/mips/include/asm/ |
H 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()
|
/openbmc/linux/arch/mips/dec/ |
H 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() 37 * The PROM will reset the year to either '72 or '73. in read_persistent_clock64() 38 * Therefore we store the real year separately, in one 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()
|