2 Add custom commands for BeagleBoard development.
4 Copyright (c) 2008-2009, Apple Inc. All rights reserved.
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/ArmLib.h>
18 #include <Library/CacheMaintenanceLib.h>
19 #include <Library/EblCmdLib.h>
20 #include <Library/BaseLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/UefiRuntimeServicesTableLib.h>
24 #include <Library/MemoryAllocationLib.h>
25 #include <Library/UefiLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/EfiFileLib.h>
28 #include <Library/ArmDisassemblerLib.h>
30 //PcdEmbeddedFdBaseAddress
35 Argv[0] - "%CommandName%"
37 @param Argc Number of command arguments in Argv
38 @param Argv Array of strings that represent the parsed command line.
39 Argv[0] is the comamnd name
56 return EFI_INVALID_PARAMETER
;
59 Address
= AsciiStrHexToUintn (Argv
[1]);
60 Count
= (Argc
> 2) ? (UINT32
)AsciiStrHexToUintn (Argv
[2]) : 10;
62 Ptr
= (UINT8
*)(UINTN
)Address
;
64 DisassembleInstruction (&Ptr
, TRUE
, TRUE
, Buffer
, sizeof (Buffer
));
65 AsciiPrint ("0x%08x: %a", Address
, Buffer
);
72 GLOBAL_REMOVE_IF_UNREFERENCED
const EBL_COMMAND_TABLE mLibCmdTemplate
[] =
75 "disasm address [count]",
76 " disassemble count instructions",
84 EblInitializeExternalCmd (
88 EblAddCommands (mLibCmdTemplate
, sizeof (mLibCmdTemplate
)/sizeof (EBL_COMMAND_TABLE
));