svn commit: r331028 - in stable/11/sys: dev/efidev sys
Kyle Evans
kevans at FreeBSD.org
Thu Mar 15 20:46:35 UTC 2018
Author: kevans
Date: Thu Mar 15 20:46:34 2018
New Revision: 331028
URL: https://svnweb.freebsd.org/changeset/base/331028
Log:
MFC r330257: Add a function to retrieve the EFI realtime clock capabilities.
Modified:
stable/11/sys/dev/efidev/efirt.c
stable/11/sys/sys/efi.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/efidev/efirt.c
==============================================================================
--- stable/11/sys/dev/efidev/efirt.c Thu Mar 15 20:43:22 2018 (r331027)
+++ stable/11/sys/dev/efidev/efirt.c Thu Mar 15 20:46:34 2018 (r331028)
@@ -242,7 +242,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;
@@ -251,7 +251,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);
@@ -265,7 +265,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: stable/11/sys/sys/efi.h
==============================================================================
--- stable/11/sys/sys/efi.h Thu Mar 15 20:43:22 2018 (r331027)
+++ stable/11/sys/sys/efi.h Thu Mar 15 20:46:34 2018 (r331028)
@@ -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-stable-11
mailing list