Lines Matching refs:eft
27 compute_yday(efi_time_t *eft) in compute_yday() argument
30 return rtc_year_days(eft->day, eft->month - 1, eft->year); in compute_yday()
37 compute_wday(efi_time_t *eft, int yday) in compute_wday() argument
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()
53 convert_to_efi_time(struct rtc_time *wtime, efi_time_t *eft) in convert_to_efi_time() argument
55 eft->year = wtime->tm_year + 1900; in convert_to_efi_time()
56 eft->month = wtime->tm_mon + 1; in convert_to_efi_time()
57 eft->day = wtime->tm_mday; in convert_to_efi_time()
58 eft->hour = wtime->tm_hour; in convert_to_efi_time()
59 eft->minute = wtime->tm_min; in convert_to_efi_time()
60 eft->second = wtime->tm_sec; in convert_to_efi_time()
61 eft->nanosecond = 0; in convert_to_efi_time()
62 eft->daylight = wtime->tm_isdst ? EFI_ISDST : 0; in convert_to_efi_time()
63 eft->timezone = EFI_UNSPECIFIED_TIMEZONE; in convert_to_efi_time()
67 convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime) in convert_from_efi_time() argument
71 if (eft->second >= 60) in convert_from_efi_time()
73 wtime->tm_sec = eft->second; in convert_from_efi_time()
75 if (eft->minute >= 60) in convert_from_efi_time()
77 wtime->tm_min = eft->minute; in convert_from_efi_time()
79 if (eft->hour >= 24) in convert_from_efi_time()
81 wtime->tm_hour = eft->hour; in convert_from_efi_time()
83 if (!eft->day || eft->day > 31) in convert_from_efi_time()
85 wtime->tm_mday = eft->day; in convert_from_efi_time()
87 if (!eft->month || eft->month > 12) in convert_from_efi_time()
89 wtime->tm_mon = eft->month - 1; in convert_from_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()
96 wtime->tm_yday = compute_yday(eft); in convert_from_efi_time()
99 wtime->tm_wday = compute_wday(eft, wtime->tm_yday); in convert_from_efi_time()
101 switch (eft->daylight & EFI_ISDST) { in convert_from_efi_time()
117 efi_time_t eft; in efi_read_alarm() local
124 (efi_bool_t *)&wkalrm->pending, &eft); in efi_read_alarm()
129 if (!convert_from_efi_time(&eft, &wkalrm->time)) in efi_read_alarm()
137 efi_time_t eft; in efi_set_alarm() local
140 convert_to_efi_time(&wkalrm->time, &eft); in efi_set_alarm()
150 status = efi.set_wakeup_time((efi_bool_t)wkalrm->enabled, &eft); in efi_set_alarm()
160 efi_time_t eft; in efi_read_time() local
163 status = efi.get_time(&eft, &cap); in efi_read_time()
171 if (!convert_from_efi_time(&eft, tm)) in efi_read_time()
180 efi_time_t eft; in efi_set_time() local
182 convert_to_efi_time(tm, &eft); in efi_set_time()
184 status = efi.set_time(&eft); in efi_set_time()
191 efi_time_t eft, alm; in efi_procfs() local
195 memset(&eft, 0, sizeof(eft)); in efi_procfs()
199 efi.get_time(&eft, &cap); in efi_procfs()
206 eft.hour, eft.minute, eft.second, eft.nanosecond, in efi_procfs()
207 eft.year, eft.month, eft.day, in efi_procfs()
208 eft.daylight); in efi_procfs()
210 if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE) in efi_procfs()
214 seq_printf(seq, "Timezone\t: %u\n", eft.timezone); in efi_procfs()
228 if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE) in efi_procfs()
257 efi_time_t eft; in efi_rtc_probe() local
261 if (efi.get_time(&eft, &cap) != EFI_SUCCESS) in efi_rtc_probe()