grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] commands/efi/lsefisystab: human readable revision


From: Heinrich Schuchardt
Subject: [PATCH 1/1] commands/efi/lsefisystab: human readable revision
Date: Fri, 14 Jul 2023 08:12:30 +0200

Print the UEFI specification revision in human readable form, e.g.
2.10 instead of 00020064 and 2.3.1 instead of 0002001f.

See UEFI 2.10 specification, chapter 4.2.1 EFI_TABLE_HEADER

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 grub-core/commands/efi/lsefisystab.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/grub-core/commands/efi/lsefisystab.c 
b/grub-core/commands/efi/lsefisystab.c
index 79ccee12a..ffb24fc3b 100644
--- a/grub-core/commands/efi/lsefisystab.c
+++ b/grub-core/commands/efi/lsefisystab.c
@@ -64,12 +64,18 @@ grub_cmd_lsefisystab (struct grub_command *cmd 
__attribute__ ((unused)),
                      char **args __attribute__ ((unused)))
 {
   const grub_efi_system_table_t *st = grub_efi_system_table;
+  const grub_efi_uint32_t major_rev = st->hdr.revision >> 16;
+  const grub_efi_uint32_t minor_rev_upper = (st->hdr.revision & 0xffff) / 10;
+  const grub_efi_uint32_t minor_rev_lower = (st->hdr.revision & 0xffff) % 10;
   grub_efi_configuration_table_t *t;
   unsigned int i;
 
   grub_printf ("Address: %p\n", st);
-  grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %08x\n",
-              st->hdr.signature, st->hdr.revision);
+  grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %u.%u",
+              st->hdr.signature, major_rev, minor_rev_upper);
+  if (minor_rev_lower)
+     grub_printf (".%u", minor_rev_lower);
+  grub_printf ("\n");
   {
     char *vendor;
     grub_uint16_t *vendor_utf16;
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]