Lines Matching defs:eft

27 compute_yday(efi_time_t *eft)
30 return rtc_year_days(eft->day, eft->month - 1, eft->year);
37 compute_wday(efi_time_t *eft, int yday)
39 int ndays = eft->year * (365 % 7)
40 + (eft->year - 1) / 4
41 - (eft->year - 1) / 100
42 + (eft->year - 1) / 400
53 convert_to_efi_time(struct rtc_time *wtime, efi_time_t *eft)
55 memset(eft, 0, sizeof(*eft));
56 eft->year = wtime->tm_year + 1900;
57 eft->month = wtime->tm_mon + 1;
58 eft->day = wtime->tm_mday;
59 eft->hour = wtime->tm_hour;
60 eft->minute = wtime->tm_min;
61 eft->second = wtime->tm_sec;
62 eft->nanosecond = 0;
63 eft->daylight = wtime->tm_isdst ? EFI_ISDST : 0;
64 eft->timezone = EFI_UNSPECIFIED_TIMEZONE;
68 convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
72 if (eft->second >= 60)
74 wtime->tm_sec = eft->second;
76 if (eft->minute >= 60)
78 wtime->tm_min = eft->minute;
80 if (eft->hour >= 24)
82 wtime->tm_hour = eft->hour;
84 if (!eft->day || eft->day > 31)
86 wtime->tm_mday = eft->day;
88 if (!eft->month || eft->month > 12)
90 wtime->tm_mon = eft->month - 1;
92 if (eft->year < 1900 || eft->year > 9999)
94 wtime->tm_year = eft->year - 1900;
97 wtime->tm_yday = compute_yday(eft);
100 wtime->tm_wday = compute_wday(eft, wtime->tm_yday);
102 switch (eft->daylight & EFI_ISDST) {
118 efi_time_t eft;
121 memset(&eft, 0, sizeof(eft));
123 (efi_bool_t *)&wkalrm->pending, &eft);
127 if (!convert_from_efi_time(&eft, &wkalrm->time))
135 efi_time_t eft;
138 convert_to_efi_time(&wkalrm->time, &eft);
140 status = efi.set_wakeup_time((efi_bool_t)!!wkalrm->enabled, &eft);
148 efi_time_t eft;
151 status = efi.get_time(&eft, &cap);
159 if (!convert_from_efi_time(&eft, tm))
168 efi_time_t eft;
170 convert_to_efi_time(tm, &eft);
172 status = efi.set_time(&eft);
179 efi_time_t eft, alm;
184 memset(&eft, 0, sizeof(eft));
188 efi.get_time(&eft, &cap);
199 eft.hour, eft.minute, eft.second, eft.nanosecond,
200 eft.year, eft.month, eft.day,
201 eft.daylight);
203 if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE)
207 seq_printf(seq, "Timezone\t: %u\n", eft.timezone);
251 efi_time_t eft;
256 if (efi.get_time(&eft, &cap) != EFI_SUCCESS)
277 efi.get_wakeup_time(&enabled, &pending, &eft) == EFI_SUCCESS) {