]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/ElfConvert.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / C / GenFw / ElfConvert.h
index fc8c63f34bdcf4fb3d7acc908c72f0d364c0e3b1..6ab46052271a3d968ce094922256fe6d6176c69e 100644 (file)
@@ -3,13 +3,7 @@ Header file for Elf convert solution
 \r
 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
-This program and the accompanying materials are licensed and made available \r
-under the terms and conditions of the BSD License which accompanies this \r
-distribution.  The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -30,6 +24,7 @@ extern UINT8  *mCoffFile;
 extern UINT32 mTableOffset;\r
 extern UINT32 mOutImageType;\r
 extern UINT32 mFileBufferSize;\r
+extern BOOLEAN mExportFlag;\r
 \r
 //\r
 // Common EFI specific data.\r
@@ -37,6 +32,44 @@ extern UINT32 mFileBufferSize;
 #define ELF_HII_SECTION_NAME ".hii"\r
 #define ELF_STRTAB_SECTION_NAME ".strtab"\r
 #define MAX_COFF_ALIGNMENT 0x10000\r
+#define ELF_SYMBOL_SECTION_NAME ".symtab"\r
+\r
+//\r
+// Platform Runtime Mechanism (PRM) specific data.\r
+//\r
+#define PRM_MODULE_EXPORT_SYMBOL_NUM 256\r
+\r
+// <to-do> to include PRM header directly once PrmPkg is in main repo\r
+#define PRM_HANDLER_NAME_MAXIMUM_LENGTH 128\r
+\r
+#define PRM_MODULE_EXPORT_DESCRIPTOR_NAME         "PrmModuleExportDescriptor"\r
+#define PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE    SIGNATURE_64 ('P', 'R', 'M', '_', 'M', 'E', 'D', 'T')\r
+#define PRM_MODULE_EXPORT_REVISION                0x0\r
+\r
+//\r
+// Platform Runtime Mechanism (PRM) Export Descriptor Structures\r
+//\r
+#pragma pack(push, 1)\r
+\r
+typedef struct {\r
+  EFI_GUID                              PrmHandlerGuid;\r
+  CHAR8                                 PrmHandlerName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];\r
+} PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT;\r
+\r
+typedef struct {\r
+  UINT64                                Signature;\r
+  UINT16                                Revision;\r
+  UINT16                                NumberPrmHandlers;\r
+  EFI_GUID                              PlatformGuid;\r
+  EFI_GUID                              ModuleGuid;\r
+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER;\r
+\r
+typedef struct {\r
+  PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER  Header;\r
+  PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT        PrmHandlerExportDescriptors[1];\r
+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT;\r
+\r
+#pragma pack(pop)\r
 \r
 //\r
 // Filter Types\r
@@ -44,21 +77,23 @@ extern UINT32 mFileBufferSize;
 typedef enum {\r
   SECTION_TEXT,\r
   SECTION_HII,\r
-  SECTION_DATA\r
-  \r
+  SECTION_DATA,\r
+  SECTION_SYMBOL\r
+\r
 } SECTION_FILTER_TYPES;\r
 \r
 //\r
-// FunctionTalbe\r
+// FunctionTable\r
 //\r
 typedef struct {\r
   VOID    (*ScanSections) ();\r
   BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES  FilterType);\r
   VOID    (*WriteRelocations) ();\r
   VOID    (*WriteDebug) ();\r
+  VOID    (*WriteExport) ();\r
   VOID    (*SetImageSize) ();\r
   VOID    (*CleanUp) ();\r
-  \r
+\r
 } ELF_FUNCTION_TABLE;\r
 \r
 //\r