8 #define KEY_ESCAPE 0x1B
10 #define KEY_BACKSPACE 0x7f //0x08
32 for (; *Str != Char; ++Str)
51 UINTN NumOfArgs, itemp;
59 AsciiSPrint(OutArgs->
command,
sizeof(OutArgs->
command) - 1,
"%a", Cmd);
63 itemp = (UINTN)(p - Cmd);
64 if (itemp >=
sizeof(OutArgs->
command))
69 #define get_arg(argx, argx_val) { pp = AsciiStrChr(++p, ' '); \
70 if (!pp) return NumOfArgs; \
71 itemp = (UINTN)(pp - p); \
72 if ((itemp >= (sizeof(OutArgs->argx) - 1)) || (itemp < 1)) return NumOfArgs; \
73 MemCopy(OutArgs->argx, p, itemp); \
74 OutArgs->argx_val = (ULONG32)AsciiStrHexToUintn(OutArgs->argx); \
77 OutArgs->argc = NumOfArgs; }
82 OutArgs->
argc = NumOfArgs;
100 CHAR8 Attributes[256];
107 LogFullAscii(
"%a: Error: GetMemoryMapList() returned 0\r\n", __FUNCTION__);
108 return EFI_NOT_FOUND;
119 LogFullAscii(
"%a: Map Entry Found: PhysStart=%016lx NumOfPages=%08llx VirtualStart=%016lx Attributes=%016lx (%a)\r\n",
128 LogFullAscii(
"%a: meminfo entry not found\r\n", __FUNCTION__);
154 LogFullAscii(
"error: GetAllImagesWithDescription returned 0\r\n");
155 return EFI_NOT_FOUND;
163 LogFullAscii(
"%a: image entry found -> handle=%08x imagebase=%p imagesize=%x name=%a filepath=%a\r\n",
174 LogFullAscii(
"%a: unable to locate image, address = %x!\r\n",
177 return EFI_NOT_FOUND;
199 CHAR16 DmpFilePath[64];
204 __FUNCTION__, Args->
argc);
205 return EFI_NOT_FOUND;
215 UnicodeSPrint(DmpFilePath,
sizeof(DmpFilePath)-1, L
"%a", Args->
arg3);
243 __FUNCTION__, Args->
arg1, Addr);
246 __FUNCTION__, Args->
arg1);
263 CHAR8 EventTypeBuff[128];
271 LogFullAscii(
"%a: unable to receive EventList\r\n", __FUNCTION__);
272 return EFI_NOT_FOUND;
283 if (strcmp(Args->
arg1,
"type") == 0)
287 if (strcmp(Args->
arg2,
"TIMER") == 0)
289 else if (strcmp(Args->
arg2,
"RUNTIME") == 0)
291 else if (strcmp(Args->
arg2,
"NOTIFY_WAIT") == 0)
292 Type = EVT_NOTIFY_WAIT;
293 else if (strcmp(Args->
arg2,
"NOTIFY_SIGNAL") == 0)
294 Type = EVT_NOTIFY_SIGNAL;
295 else if (strcmp(Args->
arg2,
"SIGNAL_EXIT") == 0)
296 Type = EVT_SIGNAL_EXIT_BOOT_SERVICES;
297 else if (strcmp(Args->
arg2,
"SIGNAL_VA_CHANGE") == 0)
298 Type = EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE;
304 if ((EventEntry->
Type & Type) == Type)
307 LogFullAscii(
"%a: event entry found addr = %p, function ptr = %p, type = %a\r\n",
316 else if (strcmp(Args->
arg1,
"addr") == 0)
323 LogFullAscii(
"%a: event entry found addr = %p, function ptr = %p, type = %a\r\n",
330 LogFullAscii(
"%a: unable to find event entry for addr = %x\r\n",
334 LogFullAscii(
"%a: invalid command syntax\r\n", __FUNCTION__);
348 LogFullAscii(
"-----------------------------------------------\r\n");
349 LogFullAscii(
"%a: RDFU CONSOLE HELP \r\n", __FUNCTION__);
350 LogFullAscii(
"%a: available commands\r\n", __FUNCTION__);
351 LogFullAscii(
"-----------------------------------------------\r\n");
355 LogFullAscii(
"dumpmem <STARTADDR> <SIZE> <FILENAME>\r\n");
359 LogFullAscii(
"eventinfo type <TIMER/RUNTIME/NOTIFY_WAIT/NOTIFY_SIGNAL/SIGNAL_EXIT/SIGNAL_VA_CHANGE>\r\n");
360 LogFullAscii(
"-----------------------------------------------\r\n");
383 if (strcmp(Args.
command,
"show") == 0)
385 if (strcmp(Args.
arg1,
"gdt") == 0)
387 else if (strcmp(Args.
arg1,
"idt") == 0)
389 else if (strcmp(Args.
arg1,
"context") == 0)
392 LogFullAscii(
"%a: '%a' invalid syntax\r\n", __FUNCTION__, Cmd);
394 else if (strcmp(Args.
command,
"meminfo") == 0)
398 else if (strcmp(Args.
command,
"driverinfo") == 0)
402 else if (strcmp(Args.
command,
"dumpmem") == 0)
406 else if (strcmp(Args.
command,
"function") == 0)
410 else if (strcmp(Args.
command,
"eventinfo") == 0)
414 else if (strcmp(Args.
command,
"help") == 0)
462 AsciiPrint(
"Got command: %a\r\n", Cmd);
476 if (Index >= (
sizeof(Cmd) - 1))