Commit 35e313cf authored by Ian Lepore's avatar Ian Lepore
Browse files

Add a function to retrieve the EFI realtime clock capabilities.

parent 58dcf3ff
......@@ -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);
}
......
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment