grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 1/2] efi: add function to read EFI variables with attribut


From: Daniel Kiper
Subject: Re: [PATCH v2 1/2] efi: add function to read EFI variables with attributes
Date: Thu, 18 Oct 2018 10:48:33 +0200
User-agent: Mutt/1.3.28i

On Wed, Oct 17, 2018 at 06:01:45PM +0000, Ignat Korchagin wrote:

May I ask you to add a few words here why this change is needed.

> Signed-off-by: Ignat Korchagin <address@hidden>
> ---
>  grub-core/kern/efi/efi.c | 13 +++++++++++--
>  include/grub/efi/efi.h   |  4 ++++
>  2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
> index 708581fcb..5f7d1478f 100644
> --- a/grub-core/kern/efi/efi.c
> +++ b/grub-core/kern/efi/efi.c
> @@ -224,7 +224,16 @@ grub_efi_set_variable(const char *var, const 
> grub_efi_guid_t *guid,
>
>  void *
>  grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
> -                    grub_size_t *datasize_out)
> +                       grub_size_t *datasize_out)
> +{
> +  return grub_efi_get_variable_with_attributes (var, guid, datasize_out, 
> NULL);
> +}
> +
> +void *
> +grub_efi_get_variable_with_attributes (const char *var,
> +                                       const grub_efi_guid_t *guid,
> +                                       grub_size_t *datasize_out,
> +                                       grub_efi_uint32_t *attributes)

Please put grub_efi_get_variable_with_attributes() before
grub_efi_get_variable().

>  {
>    grub_efi_status_t status;
>    grub_efi_uintn_t datasize = 0;
> @@ -260,7 +269,7 @@ grub_efi_get_variable (const char *var, const 
> grub_efi_guid_t *guid,
>        return NULL;
>      }
>
> -  status = efi_call_5 (r->get_variable, var16, guid, NULL, &datasize, data);
> +  status = efi_call_5 (r->get_variable, var16, guid, attributes, &datasize, 
> data);
>    grub_free (var16);
>
>    if (status == GRUB_EFI_SUCCESS)
> diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
> index 2c6648d46..727722797 100644
> --- a/include/grub/efi/efi.h
> +++ b/include/grub/efi/efi.h
> @@ -77,6 +77,10 @@ grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) 
> (grub_efi_uintn_t memo
>  void *EXPORT_FUNC (grub_efi_get_variable) (const char *variable,
>                                          const grub_efi_guid_t *guid,
>                                          grub_size_t *datasize_out);
> +void *EXPORT_FUNC (grub_efi_get_variable_with_attributes) (const char 
> *variable,
> +                                                           const 
> grub_efi_guid_t *guid,
> +                                                           grub_size_t 
> *datasize_out,
> +                                                           grub_efi_uint32_t 
> *attributes);

Same here.

If you do everything which I have asked for you can add
  Reviewed-by: Daniel Kiper <address@hidden>

Daniel



reply via email to

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