All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 02/16] efi: Update some comments related to smbios tables
Date: Wed, 16 May 2018 18:30:17 +0200	[thread overview]
Message-ID: <4ffea546-336a-2d0f-511a-11351ba9cb7e@gmx.de> (raw)
In-Reply-To: <20180516154233.21457-3-sjg@chromium.org>

On 05/16/2018 05:42 PM, Simon Glass wrote:
> Clarify the operation of this code with some additional comments.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
> 
> Changes in v4:
> - Remove code already applied
> - Update subject
> 
> Changes in v3:
> - Add comments on aligment
> - Return error value of efi_allocate_pages()
> - Update function comment for write_smbios_table()
> 
> Changes in v2:
> - Update return type of efi_smbios_register() to efi_status_t
> - Use return value of efi_install_configuration_table
> 
>  include/efi_loader.h        | 7 +++++++
>  include/smbios.h            | 5 +++--
>  lib/efi_loader/efi_smbios.c | 7 ++++++-
>  3 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 2868ca25abb..2519a7c33a7 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -207,6 +207,13 @@ efi_status_t efi_net_register(void);
>  /* Called by bootefi to make the watchdog available */
>  efi_status_t efi_watchdog_register(void);
>  /* Called by bootefi to make SMBIOS tables available */
> +/**
> + * efi_smbios_register() - write out SMBIOS tables
> + *
> + * Called by bootefi to make SMBIOS tables available
> + *
> + * @return 0 if OK, -ENOMEM if no memory is available for the tables
> + */
>  efi_status_t efi_smbios_register(void);
>  
>  struct efi_simple_file_system_protocol *
> diff --git a/include/smbios.h b/include/smbios.h
> index 79880ef5b5c..97b9ddce237 100644
> --- a/include/smbios.h
> +++ b/include/smbios.h
> @@ -231,8 +231,9 @@ typedef int (*smbios_write_type)(ulong *addr, int handle);
>   *
>   * This writes SMBIOS table at a given address.
>   *
> - * @addr:	start address to write SMBIOS table
> - * @return:	end address of SMBIOS table
> + * @addr:	start address to write SMBIOS table. If this is not
> + *	16-byte-aligned then it will be aligned before the table is written
> + * @return:	end address of SMBIOS table (and start address for next entry)
>   */
>  ulong write_smbios_table(ulong addr);
>  
> diff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c
> index 482436e2adb..7c3fc8af0b2 100644
> --- a/lib/efi_loader/efi_smbios.c
> +++ b/lib/efi_loader/efi_smbios.c
> @@ -29,7 +29,12 @@ efi_status_t efi_smbios_register(void)
>  	if (ret != EFI_SUCCESS)
>  		return ret;
>  
> -	/* Generate SMBIOS tables */
> +	/*
> +	 * Generate SMBIOS tables - we know that efi_allocate_pages() returns
> +	 * a 4k-aligned address, so it is safe to assume that
> +	 * write_smbios_table() will write the table at that address.
> +	 */
> +	assert(!(dmi & 0xf));
>  	write_smbios_table(dmi);
>  
>  	/* And expose them to our EFI payload */
> 

  reply	other threads:[~2018-05-16 16:30 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 15:42 [U-Boot] [PATCH v4 00/16] efi: Enable basic sandbox support for EFI loader Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 01/16] efi: Init the 'rows' and 'cols' variables Simon Glass
2018-05-16 16:21   ` Heinrich Schuchardt
2018-05-16 15:42 ` [U-Boot] [PATCH v4 02/16] efi: Update some comments related to smbios tables Simon Glass
2018-05-16 16:30   ` Heinrich Schuchardt [this message]
2018-05-24 12:44   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2018-05-16 15:42 ` [U-Boot] [PATCH v4 03/16] efi: sandbox: Adjust memory usage for sandbox Simon Glass
2018-05-16 17:02   ` Heinrich Schuchardt
2018-05-16 17:15   ` Heinrich Schuchardt
2018-05-24 19:16     ` Heinrich Schuchardt
2018-05-25  2:42       ` Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 04/16] sandbox: smbios: Update to support sandbox Simon Glass
2018-05-24 12:24   ` Alexander Graf
2018-05-25  2:42     ` Simon Glass
2018-06-03 12:13       ` Alexander Graf
2018-06-07 20:25         ` Simon Glass
2018-06-07 20:36           ` Alexander Graf
2018-06-07 20:41             ` Simon Glass
2018-06-07 20:47               ` Alexander Graf
2018-06-08 21:59                 ` Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 05/16] sandbox: Add a setjmp() implementation Simon Glass
2018-05-24 12:44   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2018-06-15 12:01   ` [U-Boot] [PATCH v4 " Alexander Graf
2018-06-15 15:16     ` Simon Glass
2018-06-15 19:59       ` Alexander Graf
2018-05-16 15:42 ` [U-Boot] [PATCH v4 06/16] efi: sandbox: Add required linker sections Simon Glass
2018-05-24 12:43   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2018-05-16 15:42 ` [U-Boot] [PATCH v4 07/16] efi: sandbox: Add distroboot support Simon Glass
2018-05-24 12:32   ` Alexander Graf
2018-06-12  5:27     ` Simon Glass
2018-06-12  5:42       ` Alexander Graf
2018-06-12  6:05         ` Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 08/16] Define board_quiesce_devices() in a shared location Simon Glass
2018-05-24 12:43   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2018-05-16 15:42 ` [U-Boot] [PATCH v4 09/16] Add a comment for board_quiesce_devices() Simon Glass
2018-05-24 12:43   ` [U-Boot] [U-Boot, v4, " Alexander Graf
2018-05-16 15:42 ` [U-Boot] [PATCH v4 10/16] efi: sandbox: Add relocation constants Simon Glass
2018-05-24 12:34   ` Alexander Graf
2018-06-12  5:27     ` Simon Glass
2018-06-12  5:44       ` Alexander Graf
2018-06-12  6:05         ` Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 11/16] efi: Add a comment about duplicated ELF constants Simon Glass
2018-05-16 16:47   ` Heinrich Schuchardt
2018-05-16 15:42 ` [U-Boot] [PATCH v4 12/16] efi: sandbox: Enable EFI loader builder for sandbox Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 13/16] efi: Split out test init/uninit into functions Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 14/16] efi: sandbox: Add a simple 'bootefi test' command Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 15/16] efi: Create a function to set up for running EFI code Simon Glass
2018-05-16 15:42 ` [U-Boot] [PATCH v4 16/16] efi: Rename bootefi_test_finish() to bootefi_run_finish() Simon Glass
2018-05-16 17:13 ` [U-Boot] [PATCH v4 00/16] efi: Enable basic sandbox support for EFI loader Heinrich Schuchardt
2018-05-17  5:31   ` Heinrich Schuchardt
2018-06-12  5:27     ` Simon Glass
2018-05-24 12:40 ` Alexander Graf

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=4ffea546-336a-2d0f-511a-11351ba9cb7e@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /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.