Code have been checked with spec
[mirror_edk2.git] / MdePkg / Library / DxeCoreEntryPoint / DxeCoreEntryPoint.c
1 /** @file
2 Entry point to the DXE Core.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15
16 #include <PiDxe.h>
17
18
19 #include <Library/DxeCoreEntryPoint.h>
20 #include <Library/DebugLib.h>
21 #include <Library/BaseLib.h>
22
23 //
24 // Cache copy of HobList pointer.
25 //
26 VOID *gHobList = NULL;
27
28 /**
29 The entry point of PE/COFF Image for the DXE Core.
30
31 This function is the entry point for the DXE Core. This function is required
32 to call ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never
33 expected to return. The DXE Core is responsible for calling ProcessLibraryConstructorList()
34 as soon as the EFI System Table and the image handle for the DXE Core itself have
35 been established.
36 If ProcessModuleEntryPointList() returns, then ASSERT() and halt the system.
37
38 @param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
39
40 **/
41 VOID
42 EFIAPI
43 _ModuleEntryPoint (
44 IN VOID *HobStart
45 )
46 {
47 //
48 // Cache a pointer to the HobList
49 //
50 gHobList = HobStart;
51
52 //
53 // Call the DXE Core entry point
54 //
55 ProcessModuleEntryPointList (HobStart);
56
57 //
58 // Should never return
59 //
60 ASSERT(FALSE);
61 CpuDeadLoop ();
62 }
63
64
65 /**
66 Required by the EBC compiler and identical in functionality to _ModuleEntryPoint().
67
68 This function is required to call _ModuleEntryPoint() passing in HobStart.
69
70 @param HobStart Pointer to the beginning of the HOB List passed in from the PEI Phase.
71
72 **/
73 VOID
74 EFIAPI
75 EfiMain (
76 IN VOID *HobStart
77 )
78 {
79 _ModuleEntryPoint (HobStart);
80 }