Update the EFI timer to be called once a second

There is no need to call it evert 10ms when we need 1s granularity.
Update to update the time every second.

Reviewed by:	imp, manu, tsoome
Sponsored by:	Innovate UK
Differential Revision: https://reviews.freebsd.org/D30227
This commit is contained in:
Andrew Turner 2021-05-12 08:59:04 +00:00
parent 251842c639
commit 93f7be080f

View File

@ -40,7 +40,7 @@ static void
time_update(EFI_EVENT event, void *context)
{
curtime += 10;
curtime++;
}
void
@ -50,8 +50,8 @@ efi_time_init(void)
/* Create a timer event */
BS->CreateEvent(EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
time_update, 0, &time_event);
/* Use a 10ms timer */
BS->SetTimer(time_event, TimerPeriodic, 100000);
/* Use a 1s timer */
BS->SetTimer(time_event, TimerPeriodic, 10000000);
}
void
@ -68,7 +68,7 @@ time(time_t *tloc)
{
time_t t;
t = curtime / 1000;
t = curtime;
if (tloc != NULL)
*tloc = t;