]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Ebl/Ebl.h
48b69660fbb7e94a01461978206c465f0d11f02f
[mirror_edk2.git] / EmbeddedPkg / Ebl / Ebl.h
1 /** @file
2 Include flie for basic command line parser for EBL (Embedded Boot Loader)
3
4 Copyright (c) 2007, Intel Corporation<BR>
5 Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
6
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __EBL_H__
18 #define __EBL_H__
19
20 #include <PiDxe.h>
21 #include <Protocol/BlockIo.h>
22 #include <Protocol/SimpleFileSystem.h>
23 #include <Protocol/FirmwareVolume2.h>
24 #include <Protocol/LoadFile.h>
25 #include <Protocol/FirmwareVolumeBlock.h>
26 #include <Protocol/PxeBaseCode.h>
27 #include <Protocol/LoadedImage.h>
28 #include <Protocol/EblAddCommand.h>
29 #include <Protocol/PciIo.h>
30 #include <Protocol/DevicePath.h>
31
32 #include <Guid/FileInfo.h>
33 #include <Guid/DxeServices.h>
34 #include <Guid/MemoryTypeInformation.h>
35 #include <Guid/MemoryAllocationHob.h>
36 #include <Library/BaseLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/PrintLib.h>
40 #include <Library/BaseMemoryLib.h>
41 #include <Library/UefiLib.h>
42 #include <Library/UefiBootServicesTableLib.h>
43 #include <Library/UefiRuntimeServicesTableLib.h>
44 #include <Library/DebugLib.h>
45 #include <Library/EfiFileLib.h>
46 #include <Library/HobLib.h>
47 #include <Library/DebugLib.h>
48 #include <Library/IoLib.h>
49 #include <Library/PcdLib.h>
50 #include <Library/EblCmdLib.h>
51 #include <Library/DevicePathLib.h>
52 #include <Library/UefiLib.h>
53 #include <Library/EblNetworkLib.h>
54
55 #include <IndustryStandard/Pci.h>
56
57 //
58 // Prompt for the command line
59 //
60 #define CMD_SEPERATOR ';'
61 #define EBL_MAX_COMMAND_COUNT 0x100
62 #define MAX_CMD_HISTORY 16
63 #define MAX_CMD_LINE 256
64 #define MAX_ARGS 32
65
66 #define EBL_CR 0x0a
67 #define EBL_LF 0x0d
68
69 #define EFI_SET_TIMER_TO_SECOND 10000000
70
71
72
73 EBL_COMMAND_TABLE *
74 EblGetCommand (
75 IN CHAR8 *CommandName
76 );
77
78
79 EFI_STATUS
80 EblPathToDevice (
81 IN CHAR8 *Path,
82 OUT EFI_HANDLE *DeviceHandle,
83 OUT EFI_DEVICE_PATH_PROTOCOL **PathDevicePath,
84 OUT VOID **Buffer,
85 OUT UINTN *BufferSize
86 );
87
88 BOOLEAN
89 EblAnyKeyToContinueQtoQuit (
90 IN UINTN *CurrentRow,
91 IN BOOLEAN PrefixNewline
92 );
93
94 VOID
95 EblUpdateDeviceLists (
96 VOID
97 );
98
99 VOID
100 EblInitializeCmdTable (
101 VOID
102 );
103
104 VOID
105 EblShutdownExternalCmdTable (
106 VOID
107 );
108
109 VOID
110 EblSetTextColor (
111 UINTN Attribute
112 );
113
114
115 EFI_STATUS
116 EblGetCharKey (
117 IN OUT EFI_INPUT_KEY *Key,
118 IN UINTN TimoutInSec,
119 IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL
120 );
121
122 // BugBug: Move me to a library
123 INTN
124 EFIAPI
125 AsciiStrniCmp (
126 IN CONST CHAR8 *FirstString,
127 IN CONST CHAR8 *SecondString,
128 IN UINTN Length
129 );
130
131
132 VOID
133 EblInitializeDeviceCmd (
134 VOID
135 );
136
137 VOID
138 EblInitializemdHwDebugCmds (
139 VOID
140 );
141
142 VOID
143 EblInitializeDirCmd (
144 VOID
145 );
146
147 VOID
148 EblInitializeHobCmd (
149 VOID
150 );
151
152 VOID
153 EblInitializemdHwIoDebugCmds (
154 VOID
155 );
156
157 VOID
158 EblInitializeScriptCmd (
159 VOID
160 );
161
162 VOID
163 EblInitializeNetworkCmd (
164 VOID
165 );
166
167 CHAR8 *
168 ParseArguments (
169 IN CHAR8 *CmdLine,
170 OUT UINTN *Argc,
171 OUT CHAR8 **Argv
172 );
173
174 EFI_STATUS
175 ProcessCmdLine (
176 IN CHAR8 *CmdLine,
177 IN UINTN MaxCmdLineSize
178 );
179
180 EFI_STATUS
181 OutputData (
182 IN UINT8 *Address,
183 IN UINTN Length,
184 IN UINTN Width,
185 IN UINTN Offset
186 );
187
188 UINTN
189 WidthFromCommandName (
190 IN CHAR8 *Argv,
191 IN UINTN Default
192 );
193
194
195 extern UINTN gScreenColumns;
196 extern UINTN gScreenRows;
197 extern BOOLEAN gPageBreak;
198 extern CHAR8 *gMemMapType[];
199
200 #endif
201