From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <dkiper@net-space.pl>,
Ard Biesheuvel <ardb@kernel.org>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH] efi: Change grub_efi_boolean_t from char to enum
Date: Mon, 14 Aug 2023 16:38:40 -0500 [thread overview]
Message-ID: <20230814213840.1943084-1-development@efficientek.com> (raw)
This allows using GRUB_EFI_TRUE and GRUB_EFI_FALSE with proper type and
value checking. The UEFI 2.10 specification, in section 2.3.1, table 2.3,
says the size of the boolean is 1 byte and may only contain the values 0 or
1. In order to have the enum be 1-byte in size instead of the default
int-sized, add the packed attribute to the enum.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
include/grub/efi/api.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 5934db1c992b..be7c128dfb42 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -552,7 +552,13 @@ enum grub_efi_reset_type
typedef enum grub_efi_reset_type grub_efi_reset_type_t;
/* Types. */
-typedef char grub_efi_boolean_t;
+enum GRUB_PACKED grub_efi_boolean
+ {
+ GRUB_EFI_FALSE,
+ GRUB_EFI_TRUE
+ };
+typedef enum grub_efi_boolean grub_efi_boolean_t;
+
#if GRUB_CPU_SIZEOF_VOID_P == 8
typedef grub_int64_t grub_efi_intn_t;
typedef grub_uint64_t grub_efi_uintn_t;
--
2.34.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2023-08-14 21:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 21:38 Glenn Washburn [this message]
2023-08-31 18:05 ` [PATCH] efi: Change grub_efi_boolean_t from char to enum Daniel Kiper
2023-09-01 4:58 ` Glenn Washburn
2023-09-02 18:45 ` Daniel Kiper
2023-09-04 19:34 ` Glenn Washburn
2023-08-31 18:36 ` Vladimir 'phcoder' Serbinenko
2023-09-04 19:30 ` Glenn Washburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230814213840.1943084-1-development@efficientek.com \
--to=development@efficientek.com \
--cc=ardb@kernel.org \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.