svn commit: r330257 - in head/sys: dev/efidev sys
Ian Lepore
ian at FreeBSD.org
Thu Mar 1 22:57:15 UTC 2018
Author: ian
Date: Thu Mar 1 22:57:14 2018
New Revision: 330257
URL: https://svnweb.freebsd.org/changeset/base/330257
Log:
Add a function to retrieve the EFI realtime clock capabilities.
Modified:
head/sys/dev/efidev/efirt.c
head/sys/sys/efi.h
Modified: head/sys/dev/efidev/efirt.c
==============================================================================
--- head/sys/dev/efidev/efirt.c Thu Mar 1 22:38:21 2018 (r330256)
+++ head/sys/dev/efidev/efirt.c Thu Mar 1 22:57:14 2018 (r330257)
@@ -241,7 +241,7 @@ efi_get_table(struct uuid *uuid, void **ptr)
}
static int
-efi_get_time_locked(struct efi_tm *tm)
+efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap)
{
efi_status status;
int error;
@@ -250,7 +250,7 @@ efi_get_time_locked(struct efi_tm *tm)
error = efi_enter();
if (error != 0)
return (error);
- status = efi_runtime->rt_gettime(tm, NULL);
+ status = efi_runtime->rt_gettime(tm, tmcap);
efi_leave();
error = efi_status_to_errno(status);
return (error);
@@ -264,7 +264,21 @@ efi_get_time(struct efi_tm *tm)
if (efi_runtime == NULL)
return (ENXIO);
EFI_TIME_LOCK()
- error = efi_get_time_locked(tm);
+ error = efi_get_time_locked(tm, NULL);
+ EFI_TIME_UNLOCK()
+ return (error);
+}
+
+int
+efi_get_time_capabilities(struct efi_tmcap *tmcap)
+{
+ struct efi_tm dummy;
+ int error;
+
+ if (efi_runtime == NULL)
+ return (ENXIO);
+ EFI_TIME_LOCK()
+ error = efi_get_time_locked(&dummy, tmcap);
EFI_TIME_UNLOCK()
return (error);
}
Modified: head/sys/sys/efi.h
==============================================================================
--- head/sys/sys/efi.h Thu Mar 1 22:38:21 2018 (r330256)
+++ head/sys/sys/efi.h Thu Mar 1 22:57:14 2018 (r330257)
@@ -179,6 +179,7 @@ void efi_destroy_1t1_map(void);
int efi_rt_ok(void);
int efi_get_table(struct uuid *uuid, void **ptr);
int efi_get_time(struct efi_tm *tm);
+int efi_get_time_capabilities(struct efi_tmcap *tmcap);
int efi_reset_system(void);
int efi_set_time(struct efi_tm *tm);
int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
More information about the svn-src-all
mailing list