3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 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
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.
15 #ifndef _EFI_EDB_SUPPORT_H_
16 #define _EFI_EDB_SUPPORT_H_
20 #define EFI_DEBUG_PROMPT_STRING L"EDB > "
21 #define EFI_DEBUG_PROMPT_COLUMN 5
22 #define EFI_DEBUG_INPUS_BUFFER_SIZE 64
24 #define EFI_DEBUGGER_LINE_NUMBER_IN_PAGE 0x10
26 #define EFI_DEBUG_MAX_PRINT_BUFFER (80 * 4)
30 Convert hex string to uint.
32 @param Str - The string
43 Convert hex string to uint.
45 @param Str - The string
56 Convert hex string to uint.
58 @param Str - The string
69 Convert hex string to uint.
71 @param Str - The string
82 Convert hex string to uint.
84 @param Str - The string
94 Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
96 @param String - Unicode String to process
98 @param String2 - Ascii string to process
100 @return Return a positive integer if String is lexicall greater than String2; Zero if
101 the two strings are identical; and a negative interger if String is lexically
107 StrCmpUnicodeAndAscii (
114 Compare the Unicode string pointed by String to the string pointed by String2.
116 @param String - Unicode String to process
117 @param String2 - Unicode string to process
119 @return Return a positive integer if String is lexically greater than String2; Zero if
120 the two strings are identical; and a negative integer if String is lexically
133 Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
135 @param String - Unicode String to process
136 @param String2 - Ascii string to process
138 @return Return a positive integer if String is lexically greater than String2; Zero if
139 the two strings are identical; and a negative integer if String is lexically
145 StriCmpUnicodeAndAscii (
152 Verify if the string is end with the sub string.
154 @param Str - The string where to search the sub string
155 @param SubStr - The substring.
168 @param Src The string to be duplicated.
179 Find the next token after one or more specified characters.
181 @param String Point to the string where to find the substring.
182 @param CharSet Point to the string to be found.
194 Find the next token after one or more specified characters.
196 @param CharSet Point to the string to be found.
201 StrGetNextTokenLine (
207 Find the next token after one specificed characters.
209 @param String Point to the string where to find the substring.
210 @param CharSet Point to the string to be found.
215 StrGetNewTokenField (
222 Find the next token after one specificed characters.
224 @param CharSet Point to the string to be found.
229 StrGetNextTokenField (
235 Patch a character to the end of a string.
237 @param Buffer The string to be patched.
238 @param Patch The patch character.
243 PatchForStrTokenAfter (
249 Patch a character at the beginning of a string.
251 @param Buffer The string to be patched.
252 @param Patch The patch character.
257 PatchForStrTokenBefore (
264 Find the next token after one or more specified characters.
266 @param String Point to the string where to find the substring.
267 @param CharSet Point to the string to be found.
272 AsciiStrGetNewTokenLine (
279 Find the next token after one or more specified characters.
281 @param CharSet Point to the string to be found.
286 AsciiStrGetNextTokenLine (
292 Find the next token after one specificed characters.
294 @param String Point to the string where to find the substring.
295 @param CharSet Point to the string to be found.
300 AsciiStrGetNewTokenField (
307 Find the next token after one specificed characters.
309 @param CharSet Point to the string to be found.
314 AsciiStrGetNextTokenField (
320 Patch a character to the end of a string.
322 @param Buffer The string to be patched.
323 @param Patch The patch character.
328 PatchForAsciiStrTokenAfter (
334 Patch a character at the beginning of a string.
336 @param Buffer The string to be patched.
337 @param Patch The patch character.
342 PatchForAsciiStrTokenBefore (
352 @param Prompt The prompt string.
353 @param InStr Point to the input string.
354 @param StrLen The max length of string user can input.
360 IN CHAR16
*Prompt OPTIONAL
,
377 Print a Unicode string to the output device.
379 @param Format A Null-terminated Unicode format string.
380 @param ... The variable argument list that contains pointers to Null-
381 terminated Unicode strings to be printed
387 IN CONST CHAR16
*Format
,
392 Print a Unicode string to the output buffer.
394 @param Buffer A pointer to the output buffer for the produced Null-terminated
396 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
397 @param Format A Null-terminated Unicode format string.
398 @param ... The variable argument list that contains pointers to Null-
399 terminated Unicode strings to be printed
407 IN CONST CHAR16
*Format
,
412 Print a Unicode string to the output buffer with specified offset..
414 @param Buffer A pointer to the output buffer for the produced Null-terminated
416 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
417 @param Offset The offset of the buffer.
418 @param Format A Null-terminated Unicode format string.
419 @param ... The variable argument list that contains pointers to Null-
420 terminated Unicode strings to be printed
425 EDBSPrintWithOffset (
429 IN CONST CHAR16
*Format
,
436 If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs.
437 If ScanFs is TRUE, it will scan all FS and check the file.
438 If there is only one file match the name, it will be read.
439 If there is more than one file match the name, it will return Error.
441 @param DebuggerPrivate - EBC Debugger private data structure
442 @param FileName - The file to be read.
443 @param BufferSize - The file buffer size
444 @param Buffer - The file buffer
445 @param ScanFs - Need Scan all FS
447 @retval EFI_SUCCESS - read file successfully
448 @retval EFI_NOT_FOUND - file not found
449 @retval EFI_NO_MAPPING - there is duplicated files found
455 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
457 OUT UINTN
*BufferSize
,
464 Get file name under this dir with index
466 @param DebuggerPrivate - EBC Debugger private data structure
467 @param DirName - The dir to be read.
468 @param FileName - The file name pattern under this dir
469 @param Index - The file index under this dir
471 @return File Name which match the pattern and index.
476 GetFileNameUnderDir (
477 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,