9071550e |
1 | /*++\r |
2 | \r |
3 | Copyright (c) 2006, Intel Corporation \r |
4 | All rights reserved. This program and the accompanying materials \r |
5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r |
7 | http://opensource.org/licenses/bsd-license.php \r |
8 | \r |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r |
11 | \r |
12 | Module Name:\r |
13 | EfiLdr.c\r |
14 | \r |
15 | Abstract:\r |
16 | \r |
17 | Revision History:\r |
18 | \r |
19 | --*/\r |
20 | \r |
21 | #ifndef _DUET_EFI_LOADER_H_\r |
22 | #define _DUET_EFI_LOADER_H_\r |
23 | \r |
24 | #include "FrameworkDxe.h"\r |
25 | #include "Uefi.h"\r |
26 | #include "EfiLdrHandoff.h"\r |
27 | \r |
28 | #include <Protocol/LoadedImage.h>\r |
9071550e |
29 | #include <IndustryStandard/PeImage.h>\r |
30 | #include <Library/BaseLib.h>\r |
31 | #include <Library/BaseMemoryLib.h>\r |
3da85e63 |
32 | #include <Library/PrintLib.h>\r |
9071550e |
33 | \r |
34 | #define INT15_E820_AddressRangeMemory 1\r |
35 | #define INT15_E820_AddressRangeReserved 2\r |
36 | #define INT15_E820_AddressRangeACPI 3\r |
37 | #define INT15_E820_AddressRangeNVS 4\r |
38 | \r |
39 | #define EFI_FIRMWARE_BASE_ADDRESS 0x00200000\r |
40 | \r |
41 | #define EFI_DECOMPRESSED_BUFFER_ADDRESS 0x00600000\r |
42 | \r |
43 | #define EFI_MAX_MEMORY_DESCRIPTORS 64\r |
44 | \r |
45 | #define LOADED_IMAGE_SIGNATURE EFI_SIGNATURE_32('l','d','r','i')\r |
46 | \r |
47 | typedef struct {\r |
48 | UINTN Signature;\r |
49 | CHAR16 *Name; // Displayable name\r |
50 | UINTN Type;\r |
51 | \r |
52 | BOOLEAN Started; // If entrypoint has been called\r |
53 | VOID *StartImageContext;\r |
54 | \r |
55 | EFI_IMAGE_ENTRY_POINT EntryPoint; // The image's entry point\r |
56 | EFI_LOADED_IMAGE_PROTOCOL Info; // loaded image protocol\r |
57 | \r |
58 | // \r |
59 | EFI_PHYSICAL_ADDRESS ImageBasePage; // Location in memory\r |
60 | UINTN NoPages; // Number of pages \r |
61 | UINT8 *ImageBase; // As a char pointer\r |
62 | UINT8 *ImageEof; // End of memory image\r |
63 | \r |
64 | // relocate info\r |
65 | UINT8 *ImageAdjust; // Bias for reloc calculations\r |
66 | UINTN StackAddress;\r |
67 | UINT8 *FixupData; // Original fixup data\r |
68 | } EFILDR_LOADED_IMAGE;\r |
69 | \r |
70 | #pragma pack(4)\r |
71 | typedef struct { \r |
72 | UINT64 BaseAddress;\r |
73 | UINT64 Length;\r |
74 | UINT32 Type;\r |
75 | } BIOS_MEMORY_MAP_ENTRY;\r |
76 | #pragma pack()\r |
77 | \r |
78 | typedef struct { \r |
79 | UINT32 MemoryMapSize;\r |
80 | BIOS_MEMORY_MAP_ENTRY MemoryMapEntry[1];\r |
81 | } BIOS_MEMORY_MAP;\r |
82 | \r |
9071550e |
83 | EFILDR_LOADED_IMAGE DxeCoreImage;\r |
84 | EFILDR_LOADED_IMAGE DxeIplImage;\r |
85 | \r |
86 | typedef\r |
87 | VOID\r |
88 | (* EFI_MAIN_ENTRYPOINT) (\r |
89 | IN EFILDRHANDOFF *Handoff\r |
ed66e1bc |
90 | );\r |
9071550e |
91 | \r |
92 | #endif //_DUET_EFI_LOADER_H_ |