diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 19:59:57 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:06 +0100 |
commit | 4c402a058e38e0a23571678bd90b713b114aedfd (patch) | |
tree | aa5316f341d3ae5446b8d7a1ff4376ea7214e73a | |
parent | d030653880e59f39d637414cb8ae29146bb25982 (diff) | |
download | barebox-4c402a058e38.tar.gz barebox-4c402a058e38.tar.xz |
efi-stdio: fix wait_for_event argument
EFI v2.10 documents the following about EFI events:
| // EFI_EVENT: Handle to an event structure. Type VOID *
|
| typedef
| EFI_STATUS
| (EFIAPI *EFI_WAIT_FOR_EVENT) (
| IN UINTN NumberOfEvents,
| IN EFI_EVENT *Event,
| OUT UINTN *Index
| );
|
| typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
| EFI_INPUT_RESET Reset;
| EFI_INPUT_READ_KEY ReadKeyStroke;
| EFI_EVENT WaitForKey;
| } EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
To sum up, wait_for_event takes the number of events to wait for and a
pointer to an EFI_EVENT array of that size. Because we define efi_event
as void *, it went unnoticed that we passed a plain pointer instead of
a pointer to a pointer like the API expects.
With the using of an opaque type in the follow-up commit, this will
trigger a warning, so we fix this here in anticipation.
I am not sure how this went unnoticed so far, but the efi-stdio
console driver behaves as one would expect in Qemu.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-73-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/serial/efi-stdio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/serial/efi-stdio.c b/drivers/serial/efi-stdio.c index c8c8427009..d31de5f537 100644 --- a/drivers/serial/efi-stdio.c +++ b/drivers/serial/efi-stdio.c @@ -87,7 +87,7 @@ static int efi_read_key(struct efi_console_priv *priv, bool wait) /* wait until key is pressed */ if (wait) - BS->wait_for_event(1, priv->in->wait_for_key, &index); + BS->wait_for_event(1, &priv->in->wait_for_key, &index); if (priv->inex) { efiret = priv->inex->read_key_stroke_ex(priv->inex, &kd); |