]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c
fix a typo in a comment
[mirror_edk2.git] / EdkModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 24568ea334456141f08d306c05ce489712aa1139..9252d85ebf40842db9f12f730ec30b092acb9b6c 100644 (file)
@@ -21,127 +21,6 @@ Abstract:
 \r
 #include <DxeMain.h>\r
 \r
-VOID\r
-EFIAPI\r
-DxeMain (\r
-  IN  VOID *HobStart\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg0 (\r
-  VOID\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg1 (\r
-  UINTN Arg1\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg2 (\r
-  UINTN Arg1,\r
-  UINTN Arg2\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg3 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg4 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg5 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4,\r
-  UINTN Arg5\r
-  );\r
-\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
-  IN EFI_GUID  *ProtocolGuid,\r
-  IN VOID      **Interface\r
-  );\r
-  \r
-EFI_STATUS\r
-DxeMainUefiDecompressGetInfo (\r
-  IN EFI_DECOMPRESS_PROTOCOL            *This,\r
-  IN   VOID                             *Source,\r
-  IN   UINT32                           SourceSize,\r
-  OUT  UINT32                           *DestinationSize,\r
-  OUT  UINT32                           *ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainUefiDecompress (\r
-  IN EFI_DECOMPRESS_PROTOCOL              *This,\r
-  IN     VOID                             *Source,\r
-  IN     UINT32                           SourceSize,\r
-  IN OUT VOID                             *Destination,\r
-  IN     UINT32                           DestinationSize,\r
-  IN OUT VOID                             *Scratch,\r
-  IN     UINT32                           ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-DxeMainTianoDecompressGetInfo (\r
-  IN EFI_TIANO_DECOMPRESS_PROTOCOL      *This,\r
-  IN   VOID                             *Source,\r
-  IN   UINT32                           SourceSize,\r
-  OUT  UINT32                           *DestinationSize,\r
-  OUT  UINT32                           *ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainTianoDecompress (\r
-  IN EFI_TIANO_DECOMPRESS_PROTOCOL        *This,\r
-  IN     VOID                             *Source,\r
-  IN     UINT32                           SourceSize,\r
-  IN OUT VOID                             *Destination,\r
-  IN     UINT32                           DestinationSize,\r
-  IN OUT VOID                             *Scratch,\r
-  IN     UINT32                           ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-DxeMainCustomDecompressGetInfo (\r
-  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,\r
-  IN   VOID                              *Source,\r
-  IN   UINT32                            SourceSize,\r
-  OUT  UINT32                            *DestinationSize,\r
-  OUT  UINT32                            *ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainCustomDecompress (\r
-  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,\r
-  IN     VOID                            *Source,\r
-  IN     UINT32                          SourceSize,\r
-  IN OUT VOID                            *Destination,\r
-  IN     UINT32                          DestinationSize,\r
-  IN OUT VOID                            *Scratch,\r
-  IN     UINT32                          ScratchSize\r
-  );\r
-\r
 //\r
 // DXE Core Global Variables for Protocols from PEI\r
 //\r
@@ -157,7 +36,7 @@ EFI_METRONOME_ARCH_PROTOCOL       *gMetronome     = NULL;
 EFI_TIMER_ARCH_PROTOCOL           *gTimer         = NULL;\r
 EFI_BDS_ARCH_PROTOCOL             *gBds           = NULL;\r
 EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *gWatchdogTimer = NULL;\r
-EFI_RUNTIME_ARCH_PROTOCOL         *gRuntime       = NULL;\r
+\r
 \r
 //\r
 // BugBug: I'n not runtime, but is the PPI?\r
@@ -324,6 +203,26 @@ EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = {
 #endif\r
 };\r
 \r
+EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate = {\r
+  INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.ImageHead),\r
+  INITIALIZE_LIST_HEAD_VARIABLE (gRuntimeTemplate.EventHead),\r
+\r
+  //\r
+  // Make sure Size != sizeof (EFI_MEMORY_DESCRIPTOR). This will\r
+  // prevent people from having pointer math bugs in their code.\r
+  // now you have to use *DescriptorSize to make things work.\r
+  //\r
+  sizeof (EFI_MEMORY_DESCRIPTOR) + sizeof (UINT64) - (sizeof (EFI_MEMORY_DESCRIPTOR) % sizeof (UINT64)),  \r
+  EFI_MEMORY_DESCRIPTOR_VERSION, \r
+  0,\r
+  NULL,\r
+  NULL,\r
+  FALSE,\r
+  FALSE\r
+};\r
+\r
+EFI_RUNTIME_ARCH_PROTOCOL *gRuntime = &gRuntimeTemplate;\r
+\r
 //\r
 // DXE Core Global Variables for the EFI System Table, Boot Services Table, \r
 // DXE Services Table, and Runtime Services Table\r
@@ -394,12 +293,6 @@ Returns:
   EFI_PHYSICAL_ADDRESS               MemoryBaseAddress;\r
   UINT64                             MemoryLength;\r
 \r
-#ifdef EFI_DXE_PERFORMANCE\r
-  UINT64                             Tick;\r
-\r
-  GetTimerValue (&Tick);\r
-#endif\r
-\r
   mHobStart = HobStart;\r
 \r
   //\r
@@ -429,6 +322,8 @@ Returns:
   // Call constructor for all libraries\r
   //\r
   ProcessLibraryConstructorList (gDxeCoreImageHandle, gST);\r
+  PERF_END   (0,PEI_TOK, NULL, 0) ;\r
+  PERF_START (0,DXE_TOK, NULL, 0) ;\r
 \r
   //\r
   // Initialize the Global Coherency Domain Services\r
@@ -455,7 +350,7 @@ Returns:
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Initialize the ReportStatusCode with PEI version, if availible\r
+  // Initialize the ReportStatusCode with PEI version, if available\r
   //\r
   CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode);\r
 #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
@@ -557,9 +452,9 @@ Returns:
   //\r
   // Display Architectural protocols that were not loaded if this is DEBUG build\r
   //\r
-  DEBUG_CODE (\r
+  DEBUG_CODE_BEGIN ();\r
     CoreDisplayMissingArchProtocols ();\r
-  );\r
+  DEBUG_CODE_END ();\r
   \r
   //\r
   // Assert if the Architectural Protocols are not present.\r
@@ -574,9 +469,9 @@ Returns:
   // Display any drivers that were not dispatched because dependency expression\r
   // evaluated to false if this is a debug build\r
   //\r
-  DEBUG_CODE (\r
+  DEBUG_CODE_BEGIN ();\r
     CoreDisplayDiscoveredNotDispatched ();\r
-  );\r
+  DEBUG_CODE_END ();\r
 \r
   //\r
   // Transfer control to the BDS Architectural Protocol\r
@@ -890,11 +785,11 @@ CoreExitBootServices (
 \r
 Routine Description:\r
 \r
-  EFI 1.0 API to terminate Boot Services\r
+  Terminates all boot services.\r
 \r
 Arguments:\r
 \r
-  ImageHandle  - Handle that represents the identity of the calling image\r
+  ImageHandle   - Handle that identifies the exiting image.\r
 \r
   MapKey -Key to the latest memory map.\r
 \r
@@ -930,16 +825,6 @@ Returns:
   //\r
   gCpu->DisableInterrupt (gCpu);\r
 \r
-  //\r
-  // Register Runtime events with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownEventServices ();\r
-\r
-  //\r
-  // Register Runtime images with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownImageServices ();\r
-\r
   //\r
   // Report that ExitBootServices() has been called\r
   //\r
@@ -968,7 +853,12 @@ Returns:
   //\r
   SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);\r
   gBS = NULL;\r
-\r
+  \r
+  //\r
+  // Update the AtRuntime field in Runtiem AP.\r
+  //\r
+  gRuntime->AtRuntime = TRUE;\r
+  \r
   return Status;\r
 }\r
 \r