]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/SecCore/SecMain.h
UefiCpuPkg: Add SecCore module
[mirror_edk2.git] / UefiCpuPkg / SecCore / SecMain.h
diff --git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h
new file mode 100644 (file)
index 0000000..05175d2
--- /dev/null
@@ -0,0 +1,109 @@
+/** @file\r
+  Master header file for SecCore.\r
+\r
+  Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this 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
+\r
+**/\r
+\r
+#ifndef _SEC_CORE_H_\r
+#define _SEC_CORE_H_\r
+\r
+#include <PiPei.h>\r
+\r
+#include <Ppi/SecPlatformInformation.h>\r
+#include <Ppi/TemporaryRamDone.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PlatformSecLib.h>\r
+#include <Library/UefiCpuLib.h>\r
+#include <Library/PeCoffGetEntryPointLib.h>\r
+#include <Library/PeCoffExtraActionLib.h>\r
+#include <Library/DebugAgentLib.h>\r
+#include <Library/CpuExceptionHandlerLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+\r
+\r
+#define SEC_IDT_ENTRY_COUNT  34\r
+\r
+typedef struct _SEC_IDT_TABLE {\r
+  //\r
+  // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base\r
+  // address should be 8-byte alignment.\r
+  // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store\r
+  // EFI_PEI_SERVICES**\r
+  //\r
+  UINT64            PeiService;\r
+  UINT64            IdtTable[SEC_IDT_ENTRY_COUNT];\r
+} SEC_IDT_TABLE;\r
+\r
+/**\r
+  TemporaryRamDone() disables the use of Temporary RAM. If present, this service is invoked\r
+  by the PEI Foundation after the EFI_PEI_PERMANANT_MEMORY_INSTALLED_PPI is installed.\r
+\r
+  @retval EFI_SUCCESS           Use of Temporary RAM was disabled.\r
+  @retval EFI_INVALID_PARAMETER Temporary RAM could not be disabled.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SecTemporaryRamDone (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Entry point to the C language phase of SEC. After the SEC assembly\r
+  code has initialized some temporary memory and set up the stack,\r
+  the control is transferred to this function.\r
+\r
+  @param SizeOfRam           Size of the temporary memory available for use.\r
+  @param TempRamBase         Base address of temporary ram\r
+  @param BootFirmwareVolume  Base address of the Boot Firmware Volume.\r
+**/\r
+VOID\r
+EFIAPI\r
+SecStartup (\r
+  IN UINT32                   SizeOfRam,\r
+  IN UINT32                   TempRamBase,\r
+  IN VOID                     *BootFirmwareVolume\r
+  );\r
+\r
+/**\r
+  Find and return Pei Core entry point.\r
+\r
+  It also find SEC and PEI Core file debug information. It will report them if\r
+  remote debug is enabled.\r
+\r
+  @param  BootFirmwareVolumePtr  Point to the boot firmware volume.\r
+  @param  PeiCoreEntryPoint      Point to the PEI core entry point.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+FindAndReportEntryPoints (\r
+  IN  EFI_FIRMWARE_VOLUME_HEADER       *BootFirmwareVolumePtr,\r
+  OUT EFI_PEI_CORE_ENTRY_POINT         *PeiCoreEntryPoint\r
+  );\r
+\r
+/**\r
+  Auto-generated function that calls the library constructors for all of the module's\r
+  dependent libraries.  This function must be called by the SEC Core once a stack has\r
+  been established.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ProcessLibraryConstructorList (\r
+  VOID\r
+  );\r
+\r
+#endif\r