]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/PiSmmCore.h
MdeModulePkg/PciSioSerial: Fix bad EOL
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmCore.h
index f46ee72dcd16ac34728b54d49518e365a9102a34..e2fee549f8d82742c196fbf15aec7781d296e86f 100644 (file)
@@ -110,6 +110,8 @@ typedef struct {
   // Image Page Number\r
   //\r
   UINTN                           NumberOfPage;\r
+  EFI_HANDLE                      SmmImageHandle;\r
+  EFI_LOADED_IMAGE_PROTOCOL       SmmLoadedImage;\r
 } EFI_SMM_DRIVER_ENTRY;\r
 \r
 #define EFI_HANDLE_SIGNATURE            SIGNATURE_32('h','n','d','l')\r
@@ -550,6 +552,38 @@ SmmLocateProtocol (
   OUT VOID      **Interface\r
   );\r
 \r
+/**\r
+  Function returns an array of handles that support the requested protocol\r
+  in a buffer allocated from pool. This is a version of SmmLocateHandle()\r
+  that allocates a buffer for the caller.\r
+\r
+  @param  SearchType             Specifies which handle(s) are to be returned.\r
+  @param  Protocol               Provides the protocol to search by.    This\r
+                                 parameter is only valid for SearchType\r
+                                 ByProtocol.\r
+  @param  SearchKey              Supplies the search key depending on the\r
+                                 SearchType.\r
+  @param  NumberHandles          The number of handles returned in Buffer.\r
+  @param  Buffer                 A pointer to the buffer to return the requested\r
+                                 array of  handles that support Protocol.\r
+\r
+  @retval EFI_SUCCESS            The result array of handles was returned.\r
+  @retval EFI_NOT_FOUND          No handles match the search.\r
+  @retval EFI_OUT_OF_RESOURCES   There is not enough pool memory to store the\r
+                                 matching results.\r
+  @retval EFI_INVALID_PARAMETER  One or more paramters are not valid.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmLocateHandleBuffer (\r
+  IN     EFI_LOCATE_SEARCH_TYPE  SearchType,\r
+  IN     EFI_GUID                *Protocol OPTIONAL,\r
+  IN     VOID                    *SearchKey OPTIONAL,\r
+  IN OUT UINTN                   *NumberHandles,\r
+  OUT    EFI_HANDLE              **Buffer\r
+  );\r
+\r
 /**\r
   Manage SMI of a particular type.\r
 \r
@@ -980,9 +1014,66 @@ SmramProfileReadyToLock (
   VOID\r
   );\r
 \r
+/**\r
+  Initialize MemoryAttributes support.\r
+**/\r
+VOID\r
+EFIAPI\r
+SmmCoreInitializeMemoryAttributesTable (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  This function returns a copy of the current memory map. The map is an array of\r
+  memory descriptors, each of which describes a contiguous block of memory.\r
+\r
+  @param[in, out]  MemoryMapSize          A pointer to the size, in bytes, of the\r
+                                          MemoryMap buffer. On input, this is the size of\r
+                                          the buffer allocated by the caller.  On output,\r
+                                          it is the size of the buffer returned by the\r
+                                          firmware  if the buffer was large enough, or the\r
+                                          size of the buffer needed  to contain the map if\r
+                                          the buffer was too small.\r
+  @param[in, out]  MemoryMap              A pointer to the buffer in which firmware places\r
+                                          the current memory map.\r
+  @param[out]      MapKey                 A pointer to the location in which firmware\r
+                                          returns the key for the current memory map.\r
+  @param[out]      DescriptorSize         A pointer to the location in which firmware\r
+                                          returns the size, in bytes, of an individual\r
+                                          EFI_MEMORY_DESCRIPTOR.\r
+  @param[out]      DescriptorVersion      A pointer to the location in which firmware\r
+                                          returns the version number associated with the\r
+                                          EFI_MEMORY_DESCRIPTOR.\r
+\r
+  @retval EFI_SUCCESS            The memory map was returned in the MemoryMap\r
+                                 buffer.\r
+  @retval EFI_BUFFER_TOO_SMALL   The MemoryMap buffer was too small. The current\r
+                                 buffer size needed to hold the memory map is\r
+                                 returned in MemoryMapSize.\r
+  @retval EFI_INVALID_PARAMETER  One of the parameters has an invalid value.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmCoreGetMemoryMap (\r
+  IN OUT UINTN                  *MemoryMapSize,\r
+  IN OUT EFI_MEMORY_DESCRIPTOR  *MemoryMap,\r
+  OUT UINTN                     *MapKey,\r
+  OUT UINTN                     *DescriptorSize,\r
+  OUT UINT32                    *DescriptorVersion\r
+  );\r
+\r
+///\r
+/// For generic EFI machines make the default allocations 4K aligned\r
+///\r
+#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE)\r
+#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)\r
+\r
 extern UINTN                    mFullSmramRangeCount;\r
 extern EFI_SMRAM_DESCRIPTOR     *mFullSmramRanges;\r
 \r
+extern EFI_SMM_DRIVER_ENTRY       *mSmmCoreDriverEntry;\r
+\r
 extern EFI_LOADED_IMAGE_PROTOCOL  *mSmmCoreLoadedImage;\r
 \r
 //\r