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