mirror of https://github.com/acidanthera/audk.git
OvmfPkg/SmbiosPlatformDxe: clean up #includes and INF
- Sort all sections in the INF file. - Remove unused packages (MdeModulePkg) and lib classes (BaseMemoryLib) from the INF file. - Restrict some lib classes (BaseLib, HobLib) and GUIDs (gEfiXenInfoGuid) to IA32 and X64, in the INF file; only the IA32/X64 Xen implementation requires these. - Don't make "SmbiosPlatformDxe.h" #include everything just as a convenience. Spell out directly needed #includes in every file (annotate each with an example identifier consumed), drop unused #includes. - Keep #includes sorted. - Remove the leading underscore from the #include guard macro name in "SmbiosPlatformDxe.h". Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-37-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
8af38170b5
commit
7e25086a00
|
@ -6,10 +6,12 @@
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include <Library/DebugLib.h> // ASSERT_EFI_ERROR()
|
||||||
|
#include <Library/MemoryAllocationLib.h> // AllocatePool()
|
||||||
|
#include <Library/PcdLib.h> // PcdGetBool()
|
||||||
|
#include <Library/QemuFwCfgLib.h> // QemuFwCfgFindFile()
|
||||||
|
|
||||||
#include "SmbiosPlatformDxe.h"
|
#include "SmbiosPlatformDxe.h"
|
||||||
#include <Library/QemuFwCfgLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
#include <Library/PcdLib.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Locates and extracts the QEMU SMBIOS data if present in fw_cfg
|
Locates and extracts the QEMU SMBIOS data if present in fw_cfg
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_TYPE0
|
||||||
|
#include <Library/DebugLib.h> // ASSERT_EFI_ERROR()
|
||||||
|
#include <Library/MemoryAllocationLib.h> // FreePool()
|
||||||
|
#include <Library/UefiBootServicesTableLib.h> // gBS
|
||||||
|
#include <Protocol/Smbios.h> // EFI_SMBIOS_PROTOCOL
|
||||||
|
|
||||||
#include "SmbiosPlatformDxe.h"
|
#include "SmbiosPlatformDxe.h"
|
||||||
|
|
||||||
#define TYPE0_STRINGS \
|
#define TYPE0_STRINGS \
|
||||||
|
|
|
@ -8,19 +8,10 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef _SMBIOS_PLATFORM_DXE_H_
|
#ifndef SMBIOS_PLATFORM_DXE_H_
|
||||||
#define _SMBIOS_PLATFORM_DXE_H_
|
#define SMBIOS_PLATFORM_DXE_H_
|
||||||
|
|
||||||
#include <PiDxe.h>
|
|
||||||
|
|
||||||
#include <Protocol/Smbios.h>
|
|
||||||
#include <IndustryStandard/SmBios.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/BaseLib.h>
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
|
|
||||||
|
#include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_ENTRY_POINT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Locates the Xen SMBIOS data if it exists
|
Locates the Xen SMBIOS data if it exists
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
SmbiosPlatformDxe.h
|
|
||||||
SmbiosPlatformDxe.c
|
|
||||||
Qemu.c
|
Qemu.c
|
||||||
|
SmbiosPlatformDxe.c
|
||||||
|
SmbiosPlatformDxe.h
|
||||||
|
|
||||||
[Sources.IA32, Sources.X64]
|
[Sources.IA32, Sources.X64]
|
||||||
X86Xen.c
|
X86Xen.c
|
||||||
|
@ -36,19 +36,19 @@
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
|
||||||
OvmfPkg/OvmfPkg.dec
|
OvmfPkg/OvmfPkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
UefiBootServicesTableLib
|
|
||||||
BaseMemoryLib
|
|
||||||
BaseLib
|
|
||||||
UefiDriverEntryPoint
|
|
||||||
DebugLib
|
DebugLib
|
||||||
HobLib
|
|
||||||
QemuFwCfgLib
|
|
||||||
MemoryAllocationLib
|
MemoryAllocationLib
|
||||||
PcdLib
|
PcdLib
|
||||||
|
QemuFwCfgLib
|
||||||
|
UefiBootServicesTableLib
|
||||||
|
UefiDriverEntryPoint
|
||||||
|
|
||||||
|
[LibraryClasses.IA32, LibraryClasses.X64]
|
||||||
|
BaseLib
|
||||||
|
HobLib
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated
|
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||||
|
|
||||||
[Guids]
|
[Guids.IA32, Guids.X64]
|
||||||
gEfiXenInfoGuid
|
gEfiXenInfoGuid
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
|
|
|
@ -8,9 +8,11 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include <Library/BaseLib.h> // AsciiStrnCmp()
|
||||||
|
#include <Library/HobLib.h> // GetFirstGuidHob()
|
||||||
|
#include <Pi/PiHob.h> // EFI_HOB_GUID_TYPE
|
||||||
|
|
||||||
#include "SmbiosPlatformDxe.h"
|
#include "SmbiosPlatformDxe.h"
|
||||||
#include <Library/HobLib.h>
|
|
||||||
#include <Guid/XenInfo.h>
|
|
||||||
|
|
||||||
#define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000
|
#define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000
|
||||||
#define XEN_SMBIOS_PHYSICAL_END 0x000F0000
|
#define XEN_SMBIOS_PHYSICAL_END 0x000F0000
|
||||||
|
|
Loading…
Reference in New Issue