blob: c2242df9e02439edcf85854558d726551a63065a [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2 Include file for basic command line parser for EBL (Embedded Boot Loader)
3
4 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6
7 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#include <Library/TimerLib.h>
55
56#include <IndustryStandard/Pci.h>
57
58//
59// Prompt for the command line
60//
61#define CMD_SEPARATOR ';'
62#define EBL_MAX_COMMAND_COUNT 0x100
63#define MAX_CMD_HISTORY 16
64#define MAX_CMD_LINE 256
65#define MAX_ARGS 32
66
67#define EBL_CR 0x0a
68#define EBL_LF 0x0d
69
70#define EFI_SET_TIMER_TO_SECOND 10000000
71
72
73
74EBL_COMMAND_TABLE *
75EblGetCommand (
76 IN CHAR8 *CommandName
77 );
78
79
80EFI_STATUS
81EblPathToDevice (
82 IN CHAR8 *Path,
83 OUT EFI_HANDLE *DeviceHandle,
84 OUT EFI_DEVICE_PATH_PROTOCOL **PathDevicePath,
85 OUT VOID **Buffer,
86 OUT UINTN *BufferSize
87 );
88
89BOOLEAN
90EblAnyKeyToContinueQtoQuit (
91 IN UINTN *CurrentRow,
92 IN BOOLEAN PrefixNewline
93 );
94
95VOID
96EblUpdateDeviceLists (
97 VOID
98 );
99
100VOID
101EblInitializeCmdTable (
102 VOID
103 );
104
105VOID
106EblShutdownExternalCmdTable (
107 VOID
108 );
109
110VOID
111EblSetTextColor (
112 UINTN Attribute
113 );
114
115
116EFI_STATUS
117EblGetCharKey (
118 IN OUT EFI_INPUT_KEY *Key,
119 IN UINTN TimoutInSec,
120 IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL
121 );
122
123// BugBug: Move me to a library
124INTN
125EFIAPI
126AsciiStrniCmp (
127 IN CONST CHAR8 *FirstString,
128 IN CONST CHAR8 *SecondString,
129 IN UINTN Length
130 );
131
132
133VOID
134EblInitializeDeviceCmd (
135 VOID
136 );
137
138VOID
139EblInitializemdHwDebugCmds (
140 VOID
141 );
142
143VOID
144EblInitializeDirCmd (
145 VOID
146 );
147
148VOID
149EblInitializeHobCmd (
150 VOID
151 );
152
153VOID
154EblInitializemdHwIoDebugCmds (
155 VOID
156 );
157
158VOID
159EblInitializeScriptCmd (
160 VOID
161 );
162
163VOID
164EblInitializeNetworkCmd (
165 VOID
166 );
167
168VOID
169EblInitializeVariableCmds (
170 VOID
171 );
172
173CHAR8 *
174ParseArguments (
175 IN CHAR8 *CmdLine,
176 OUT UINTN *Argc,
177 OUT CHAR8 **Argv
178 );
179
180EFI_STATUS
181ProcessCmdLine (
182 IN CHAR8 *CmdLine,
183 IN UINTN MaxCmdLineSize
184 );
185
186EFI_STATUS
187OutputData (
188 IN UINT8 *Address,
189 IN UINTN Length,
190 IN UINTN Width,
191 IN UINTN Offset
192 );
193
194UINTN
195WidthFromCommandName (
196 IN CHAR8 *Argv,
197 IN UINTN Default
198 );
199
200
201extern UINTN gScreenColumns;
202extern UINTN gScreenRows;
203extern BOOLEAN gPageBreak;
204extern CHAR8 *gMemMapType[];
205
206#endif
207