]>
Commit | Line | Data |
---|---|---|
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 | |
29 | #include <Protocol/EdkDecompress.h>\r | |
30 | #include <IndustryStandard/PeImage.h>\r | |
31 | #include <Library/BaseLib.h>\r | |
32 | #include <Library/BaseMemoryLib.h>\r | |
3da85e63 | 33 | #include <Library/PrintLib.h>\r |
9071550e | 34 | \r |
35 | #define INT15_E820_AddressRangeMemory 1\r | |
36 | #define INT15_E820_AddressRangeReserved 2\r | |
37 | #define INT15_E820_AddressRangeACPI 3\r | |
38 | #define INT15_E820_AddressRangeNVS 4\r | |
39 | \r | |
40 | #define EFI_FIRMWARE_BASE_ADDRESS 0x00200000\r | |
41 | \r | |
42 | #define EFI_DECOMPRESSED_BUFFER_ADDRESS 0x00600000\r | |
43 | \r | |
44 | #define EFI_MAX_MEMORY_DESCRIPTORS 64\r | |
45 | \r | |
46 | #define LOADED_IMAGE_SIGNATURE EFI_SIGNATURE_32('l','d','r','i')\r | |
47 | \r | |
48 | typedef struct {\r | |
49 | UINTN Signature;\r | |
50 | CHAR16 *Name; // Displayable name\r | |
51 | UINTN Type;\r | |
52 | \r | |
53 | BOOLEAN Started; // If entrypoint has been called\r | |
54 | VOID *StartImageContext;\r | |
55 | \r | |
56 | EFI_IMAGE_ENTRY_POINT EntryPoint; // The image's entry point\r | |
57 | EFI_LOADED_IMAGE_PROTOCOL Info; // loaded image protocol\r | |
58 | \r | |
59 | // \r | |
60 | EFI_PHYSICAL_ADDRESS ImageBasePage; // Location in memory\r | |
61 | UINTN NoPages; // Number of pages \r | |
62 | UINT8 *ImageBase; // As a char pointer\r | |
63 | UINT8 *ImageEof; // End of memory image\r | |
64 | \r | |
65 | // relocate info\r | |
66 | UINT8 *ImageAdjust; // Bias for reloc calculations\r | |
67 | UINTN StackAddress;\r | |
68 | UINT8 *FixupData; // Original fixup data\r | |
69 | } EFILDR_LOADED_IMAGE;\r | |
70 | \r | |
71 | #pragma pack(4)\r | |
72 | typedef struct { \r | |
73 | UINT64 BaseAddress;\r | |
74 | UINT64 Length;\r | |
75 | UINT32 Type;\r | |
76 | } BIOS_MEMORY_MAP_ENTRY;\r | |
77 | #pragma pack()\r | |
78 | \r | |
79 | typedef struct { \r | |
80 | UINT32 MemoryMapSize;\r | |
81 | BIOS_MEMORY_MAP_ENTRY MemoryMapEntry[1];\r | |
82 | } BIOS_MEMORY_MAP;\r | |
83 | \r | |
9071550e | 84 | EFILDR_LOADED_IMAGE DxeCoreImage;\r |
85 | EFILDR_LOADED_IMAGE DxeIplImage;\r | |
86 | \r | |
87 | typedef\r | |
88 | VOID\r | |
89 | (* EFI_MAIN_ENTRYPOINT) (\r | |
90 | IN EFILDRHANDOFF *Handoff\r | |
91 | )\r | |
92 | ;\r | |
93 | \r | |
94 | #endif //_DUET_EFI_LOADER_H_ |