diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-01 18:59:27 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-01 18:59:27 +0000 |
commit | f9f937d243c8c9615119be2f2b35821e7de80925 (patch) | |
tree | 9cad5d4666d93113120355e7267bf891830ae199 /BeagleBoardPkg | |
parent | 097bd461c4219edb62f4595ce7ccc6ec3bb34db9 (diff) | |
download | edk2-platforms-f9f937d243c8c9615119be2f2b35821e7de80925.tar.xz |
Move ARM disassembler into a library and out of the exception handler. Add a hook to call the lib from a platform specific EBL command on BeagleBoard.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9903 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BeagleBoardPkg')
-rw-r--r-- | BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.c | 28 | ||||
-rw-r--r-- | BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf | 1 |
2 files changed, 24 insertions, 5 deletions
diff --git a/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.c b/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.c index b101049cad..6ce3f70f6d 100644 --- a/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.c +++ b/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.c @@ -25,7 +25,7 @@ #include <Library/UefiLib.h>
#include <Library/PcdLib.h>
#include <Library/EfiFileLib.h>
-
+#include <Library/ArmDisassemblerLib.h>
//PcdEmbeddedFdBaseAddress
@@ -42,11 +42,29 @@ **/
EFI_STATUS
-EblEdk2Cmd (
+EblDisassembler (
IN UINTN Argc,
IN CHAR8 **Argv
)
{
+ UINT8 *Ptr;
+ UINT32 Address;
+ UINT32 Count;
+ CHAR8 Buffer[80];
+
+ if (Argc < 2) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Address = AsciiStrHexToUintn (Argv[1]);
+ Count = (Argc > 2) ? (UINT32)AsciiStrHexToUintn (Argv[2]) : 10;
+
+ Ptr = (UINT8 *)(UINTN)Address;
+ while (Count-- > 0) {
+ DisassembleInstruction (&Ptr, TRUE, TRUE, Buffer, sizeof (Buffer));
+ AsciiPrint ("0x%08x: %a", Address, Buffer);
+ }
+
return EFI_SUCCESS;
}
@@ -54,10 +72,10 @@ EblEdk2Cmd ( GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mLibCmdTemplate[] =
{
{
- "edk2",
- " filename ; Load FD into memory and boot from it",
+ "disasm address [count]",
+ " disassemble count instructions",
NULL,
- EblEdk2Cmd
+ EblDisassembler
}
};
diff --git a/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf b/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf index 18074438c0..3590351517 100644 --- a/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf +++ b/BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf @@ -40,6 +40,7 @@ [LibraryClasses]
BaseLib
DebugLib
+ ArmDisassemblerLib
[Protocols]
|