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.
19 DebuggerCommand - Register.
21 @param CommandArg - The argument for this command
22 @param DebuggerPrivate - EBC Debugger private data structure
23 @param ExceptionType - Exception type.
24 @param SystemContext - EBC system context.
26 @retval EFI_DEBUG_CONTINUE - formal return value
31 IN CHAR16
*CommandArg
,
32 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
33 IN EFI_EXCEPTION_TYPE ExceptionType
,
34 IN OUT EFI_SYSTEM_CONTEXT SystemContext
42 // Check Argument, NULL means print all register
44 if (CommandArg
== 0) {
46 L
" R0 - 0x%016lx, R1 - 0x%016lx\n",
47 SystemContext
.SystemContextEbc
->R0
,
48 SystemContext
.SystemContextEbc
->R1
51 L
" R2 - 0x%016lx, R3 - 0x%016lx\n",
52 SystemContext
.SystemContextEbc
->R2
,
53 SystemContext
.SystemContextEbc
->R3
56 L
" R4 - 0x%016lx, R5 - 0x%016lx\n",
57 SystemContext
.SystemContextEbc
->R4
,
58 SystemContext
.SystemContextEbc
->R5
61 L
" R6 - 0x%016lx, R7 - 0x%016lx\n",
62 SystemContext
.SystemContextEbc
->R6
,
63 SystemContext
.SystemContextEbc
->R7
66 L
" Flags - 0x%016lx, ControlFlags - 0x%016lx\n",
67 SystemContext
.SystemContextEbc
->Flags
,
68 SystemContext
.SystemContextEbc
->ControlFlags
72 SystemContext
.SystemContextEbc
->Ip
74 return EFI_DEBUG_CONTINUE
;
84 RegValStr
= StrGetNextTokenLine (L
" ");
85 if (RegValStr
== NULL
) {
86 EDBPrint (L
"Invalid Register Value\n");
87 return EFI_DEBUG_CONTINUE
;
89 RegVal
= LXtoi (RegValStr
);
92 // Assign register value
94 if (StriCmp (RegName
, L
"R0") == 0) {
95 SystemContext
.SystemContextEbc
->R0
= RegVal
;
96 } else if (StriCmp (RegName
, L
"R1") == 0) {
97 SystemContext
.SystemContextEbc
->R1
= RegVal
;
98 } else if (StriCmp (RegName
, L
"R2") == 0) {
99 SystemContext
.SystemContextEbc
->R2
= RegVal
;
100 } else if (StriCmp (RegName
, L
"R3") == 0) {
101 SystemContext
.SystemContextEbc
->R3
= RegVal
;
102 } else if (StriCmp (RegName
, L
"R4") == 0) {
103 SystemContext
.SystemContextEbc
->R4
= RegVal
;
104 } else if (StriCmp (RegName
, L
"R5") == 0) {
105 SystemContext
.SystemContextEbc
->R5
= RegVal
;
106 } else if (StriCmp (RegName
, L
"R6") == 0) {
107 SystemContext
.SystemContextEbc
->R6
= RegVal
;
108 } else if (StriCmp (RegName
, L
"R7") == 0) {
109 SystemContext
.SystemContextEbc
->R7
= RegVal
;
110 } else if (StriCmp (RegName
, L
"Flags") == 0) {
111 SystemContext
.SystemContextEbc
->Flags
= RegVal
;
112 } else if (StriCmp (RegName
, L
"ControlFlags") == 0) {
113 SystemContext
.SystemContextEbc
->ControlFlags
= RegVal
;
114 } else if (StriCmp (RegName
, L
"Ip") == 0) {
115 SystemContext
.SystemContextEbc
->Ip
= RegVal
;
117 EDBPrint (L
"Invalid Register - %s\n", RegName
);
123 return EFI_DEBUG_CONTINUE
;