[PATCH] lib: fwts_smbios: only scan memory for DMI table if x86

Naresh Bhat naresh.bhat at linaro.org
Thu Apr 23 14:43:09 UTC 2015


Thanks Colin, I have tested this patch.

On 23 April 2015 at 20:04, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The SMBIOS data should only be scanned for on x86 systems as the
> location of the tables is well known to be between 0x000e0000 and
> 0x000fffff for this architecture.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_smbios.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_smbios.c b/src/lib/src/fwts_smbios.c
> index 5f67de3..cd537de 100644
> --- a/src/lib/src/fwts_smbios.c
> +++ b/src/lib/src/fwts_smbios.c
> @@ -41,6 +41,7 @@ static void *fwts_smbios_find_entry_uefi(fwts_framework *fw, fwts_smbios_entry *
>         return addr;
>  }
>
> +#if defined(FWTS_ARCH_INTEL)
>  /*
>   *  fwts_smbios_find_entry_bios()
>   *     find SMBIOS structure table entry by scanning memory
> @@ -87,6 +88,7 @@ static void *fwts_smbios_find_entry_bios(fwts_framework *fw, fwts_smbios_entry *
>
>         return addr;
>  }
> +#endif
>
>  /*
>   *  fwts_smbios_find_entry()
> @@ -102,7 +104,8 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>
>         /* Check EFI first */
>         if ((addr = fwts_smbios_find_entry_uefi(fw, entry, type)) == NULL) {
> -               /* Failed? then scan memory */
> +#if defined(FWTS_ARCH_INTEL)
> +               /* Failed? then scan x86 memory for SMBIOS tag  */
>                 addr = fwts_smbios_find_entry_bios(fw, entry, type);
>                 if (addr) {
>                         switch (*type) {
> @@ -118,6 +121,9 @@ void *fwts_smbios_find_entry(fwts_framework *fw,
>                                 break;
>                         }
>                 }
> +#else
> +               (void)version;
> +#endif
>         }
>         return addr;
>  }
> --
> 2.1.4
>
>
> --
> fwts-devel mailing list
> fwts-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel



More information about the fwts-devel mailing list