summaryrefslogtreecommitdiff
path: root/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c
blob: d9c93bdf761fde9934f39397991f799a5b547c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/** @file
  Entry point to the DXE Core.

Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/


#include <PiDxe.h>


#include <Library/DxeCoreEntryPoint.h>
#include <Library/DebugLib.h>
#include <Library/BaseLib.h>

//
// Cache copy of HobList pointer. 
// 
VOID *gHobList = NULL;

/**
  Enrty point to DXE core.

  This function is the entry point to the DXE Foundation. The PEI phase, which executes just before
  DXE, is responsible for loading and invoking the DXE Foundation in system memory. The only
  parameter that is passed to the DXE Foundation is HobStart. This parameter is a pointer to the
  HOB list that describes the system state at the hand-off to the DXE Foundation. At a minimum,
  this system state must include the following:
    - PHIT HOB
    - CPU HOB
    - Description of system memory
    - Description of one or more firmware volumes
  The DXE Foundation is also guaranteed that only one processor is running and that the processor is
  running with interrupts disabled. The implementation of the DXE Foundation must not make any
  assumptions about where the DXE Foundation will be loaded or where the stack is located. In
  general, the DXE Foundation should make as few assumptions about the state of the system as
  possible. This lack of assumptions will allow the DXE Foundation to be portable to the widest
  variety of system architectures.
  
  @param  HobStart Pointer of HobList.

**/
VOID
EFIAPI
_ModuleEntryPoint (
  IN VOID  *HobStart
  )
{
  //
  // Cache a pointer to the HobList
  //
  gHobList = HobStart;

  //
  // Call the DXE Core entry point
  //
  ProcessModuleEntryPointList (HobStart);

  //
  // Should never return
  //
  ASSERT(FALSE);
  CpuDeadLoop ();
}


/**
  Wrapper of enrty point to DXE CORE.

  @param  HobStart Pointer of HobList.

**/
VOID
EFIAPI
EfiMain (
  IN VOID  *HobStart
  )
{
  _ModuleEntryPoint (HobStart);
}