TianoCore EDK2 master
|
#include <PiSmm.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/SmmServicesTableLib.h>
#include <Library/HobLib.h>
#include <Library/DxeServicesTableLib.h>
#include <Protocol/SmmReadyToLock.h>
#include <Protocol/SmmEndOfDxe.h>
Go to the source code of this file.
Functions | |
VOID | SmmIoLibInternalCalculateMaximumSupportAddress (VOID) |
BOOLEAN EFIAPI | SmmIsMmioValid (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN EFI_GUID *Owner OPTIONAL) |
STATIC VOID | MergeGcdMmioEntry (IN OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *GcdMemoryMap, IN OUT UINTN *NumberOfDescriptors) |
EFI_STATUS EFIAPI | SmmIoLibInternalEndOfDxeNotify (IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) |
EFI_STATUS EFIAPI | SmmIoLibInternalReadyToLockNotify (IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) |
EFI_STATUS EFIAPI | SmmIoLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS EFIAPI | SmmIoLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Instance of SMM IO check library.
SMM IO check library library implementation. This library consumes GCD to collect all valid IO space defined by a platform. A platform may have its own SmmIoLib instance to exclude more IO space.
Copyright (c) 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SmmIoLib.c.
STATIC VOID MergeGcdMmioEntry | ( | IN OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR * | GcdMemoryMap, |
IN OUT UINTN * | NumberOfDescriptors | ||
) |
Merge continuous entries whose type is EfiGcdMemoryTypeMemoryMappedIo.
[in,out] | GcdMemoryMap | A pointer to the buffer in which firmware places the current GCD memory map. |
[in,out] | NumberOfDescriptors | A pointer to the number of the GcdMemoryMap buffer. On input, this is the number of the current GCD memory map. On output, it is the number of new GCD memory map after merge. |
Definition at line 167 of file SmmIoLib.c.
EFI_STATUS EFIAPI SmmIoLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The constructor function initializes the Smm IO library
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The constructor always returns EFI_SUCCESS. |
Definition at line 283 of file SmmIoLib.c.
EFI_STATUS EFIAPI SmmIoLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The destructor function frees resource used in the Smm IO library
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The deconstructor always returns EFI_SUCCESS. |
Definition at line 320 of file SmmIoLib.c.
VOID SmmIoLibInternalCalculateMaximumSupportAddress | ( | VOID | ) |
Calculate and save the maximum support address.
Definition at line 41 of file SmmIoLib.c.
EFI_STATUS EFIAPI SmmIoLibInternalEndOfDxeNotify | ( | IN CONST EFI_GUID * | Protocol, |
IN VOID * | Interface, | ||
IN EFI_HANDLE | Handle | ||
) |
Notification for SMM EndOfDxe protocol.
[in] | Protocol | Points to the protocol's unique identifier. |
[in] | Interface | Points to the interface instance. |
[in] | Handle | The handle on which the interface was installed. |
EFI_SUCCESS | Notification runs successfully. |
EFI_OUT_OF_RESOURCES | No enough resources to save GCD MMIO map. |
Definition at line 223 of file SmmIoLib.c.
EFI_STATUS EFIAPI SmmIoLibInternalReadyToLockNotify | ( | IN CONST EFI_GUID * | Protocol, |
IN VOID * | Interface, | ||
IN EFI_HANDLE | Handle | ||
) |
Notification for SMM ReadyToLock protocol.
[in] | Protocol | Points to the protocol's unique identifier. |
[in] | Interface | Points to the interface instance. |
[in] | Handle | The handle on which the interface was installed. |
EFI_SUCCESS | Notification runs successfully. |
Definition at line 262 of file SmmIoLib.c.
BOOLEAN EFIAPI SmmIsMmioValid | ( | IN EFI_PHYSICAL_ADDRESS | BaseAddress, |
IN UINT64 | Length, | ||
IN EFI_GUID *Owner | OPTIONAL | ||
) |
This function check if the MMIO resource is valid per processor architecture and valid per platform design.
BaseAddress | The MMIO start address to be checked. |
Length | The MMIO length to be checked. |
Owner | A GUID representing the owner of the resource. This GUID may be used by producer to correlate the device ownership of the resource. NULL means no specific owner. |
TRUE | This MMIO resource is valid per processor architecture and valid per platform design. |
FALSE | This MMIO resource is not valid per processor architecture or valid per platform design. |
Definition at line 95 of file SmmIoLib.c.
UINTN mSmmIoLibGcdMemNumberOfDesc = 0 |
Definition at line 27 of file SmmIoLib.c.
EFI_GCD_MEMORY_SPACE_DESCRIPTOR* mSmmIoLibGcdMemSpace = NULL |
Definition at line 26 of file SmmIoLib.c.
EFI_PHYSICAL_ADDRESS mSmmIoLibInternalMaximumSupportMemAddress = 0 |
Definition at line 29 of file SmmIoLib.c.
BOOLEAN mSmmIoLibReadyToLock = FALSE |
Definition at line 34 of file SmmIoLib.c.
VOID* mSmmIoLibRegistrationEndOfDxe |
Definition at line 31 of file SmmIoLib.c.
VOID* mSmmIoLibRegistrationReadyToLock |
Definition at line 32 of file SmmIoLib.c.