From 5207c02e4583b80d00fea0a71e9fa17915392be1 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 12 Nov 2001 09:29:05 +0000 Subject: [PATCH] Implement eficlock_set() to set hardware clock. --- sys/ia64/ia64/eficlock.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/ia64/ia64/eficlock.c b/sys/ia64/ia64/eficlock.c index bf1054928386..a7fc591b8ec5 100644 --- a/sys/ia64/ia64/eficlock.c +++ b/sys/ia64/ia64/eficlock.c @@ -65,7 +65,19 @@ eficlock_get(kobj_t dev, time_t base, struct clocktime *ct) static void eficlock_set(kobj_t dev, struct clocktime *ct) { - printf("eficlock: TODR not set\n"); + EFI_TIME time; + EFI_STATUS status; + + ia64_efi_runtime->GetTime(&time, 0); + time.Second = ct->sec; + time.Minute = ct->min; + time.Hour = ct->hour; + time.Day = ct->day; + time.Month = ct->mon; + time.Year = ct->year + 1900; + status = ia64_efi_runtime->SetTime(&time); + if (status != EFI_SUCCESS) + printf("eficlock_set: could not set TODR\n"); } static int