--- /dev/null
+/** @file\r
+ Configuration application for the EBC Debugger.\r
+\r
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Uefi.h>\r
+#include <Protocol/ShellParameters.h>\r
+\r
+#include "EdbCommon.h"\r
+#include "EdbSupport.h"\r
+\r
+VOID\r
+PrintUsage (\r
+ VOID\r
+ )\r
+{\r
+ Print (\r
+ L"EbcDebuggerConfig Version 1.0\n"\r
+ L"Copyright (C) Intel Corp 2007-2016. All rights reserved.\n"\r
+ L"\n"\r
+ L"Configure EbcDebugger in EFI Shell Environment.\n"\r
+ L"\n"\r
+ L"usage: EdbCfg <Command>\n"\r
+ L" CommandList:\n"\r
+ L" BO[C|CX|R|E|T|K] <ON|OFF> - Enable/Disable BOC/BOCX/BOR/BOE/BOT/BOK.\n"\r
+// L" SHOWINFO - Show Debugger Information.\n"\r
+ L"\n"\r
+ );\r
+ return;\r
+}\r
+\r
+VOID\r
+EdbShowInfo (\r
+ EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration\r
+ )\r
+{\r
+ Print (L"Not supported!\n");\r
+ return ;\r
+}\r
+\r
+VOID\r
+EdbConfigBreak (\r
+ EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration,\r
+ CHAR16 *Command,\r
+ CHAR16 *CommandArg\r
+ )\r
+{\r
+ EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate;\r
+\r
+ DebuggerPrivate = (EFI_DEBUGGER_PRIVATE_DATA *)DebuggerConfiguration->DebuggerPrivateData;\r
+\r
+ if (StriCmp (Command, L"BOC") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOC) == EFI_DEBUG_FLAG_EBC_BOC) {\r
+ Print (L"BOC on\n");\r
+ } else {\r
+ Print (L"BOC off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOC;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOC;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ } else if (StriCmp (Command, L"BOCX") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOCX) == EFI_DEBUG_FLAG_EBC_BOCX) {\r
+ Print (L"BOCX on\n");\r
+ } else {\r
+ Print (L"BOCX off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOCX;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOCX;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ } else if (StriCmp (Command, L"BOR") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOR) == EFI_DEBUG_FLAG_EBC_BOR) {\r
+ Print (L"BOR on\n");\r
+ } else {\r
+ Print (L"BOR off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOR;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOR;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ } else if (StriCmp (Command, L"BOE") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOE) == EFI_DEBUG_FLAG_EBC_BOE) {\r
+ Print (L"BOE on\n");\r
+ } else {\r
+ Print (L"BOE off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOE;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOE;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ } else if (StriCmp (Command, L"BOT") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOT) == EFI_DEBUG_FLAG_EBC_BOT) {\r
+ Print (L"BOT on\n");\r
+ } else {\r
+ Print (L"BOT off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOT;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOT;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ } else if (StriCmp (Command, L"BOK") == 0) {\r
+ if (CommandArg == NULL) {\r
+ if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOK) == EFI_DEBUG_FLAG_EBC_BOK) {\r
+ Print (L"BOK on\n");\r
+ } else {\r
+ Print (L"BOK off\n");\r
+ }\r
+ } else if (StriCmp (CommandArg, L"ON") == 0) {\r
+ DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOK;\r
+ } else if (StriCmp (CommandArg, L"OFF") == 0) {\r
+ DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOK;\r
+ } else {\r
+ Print (L"Invalid parameter\n");\r
+ }\r
+ }\r
+ return ;\r
+}\r
+\r
+/**\r
+ Alter the EBC Debugger configuration.\r
+\r
+ @param[in] ImageHandle The image handle.\r
+ @param[in] SystemTable The system table.\r
+\r
+ @retval EFI_SUCCESS Operation completed successfully.\r
+ @retval EFI_INVALID_PARAMETER Usage error.\r
+ @retval EFI_NOT_FOUND A running debugger cannot be located.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeEbcDebuggerConfig (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ UINTN Argc;\r
+ CHAR16 **Argv;\r
+ EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters;\r
+ EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration;\r
+ EFI_STATUS Status;\r
+\r
+ Status = gBS->HandleProtocol (\r
+ gImageHandle,\r
+ &gEfiShellParametersProtocolGuid,\r
+ (VOID**)&ShellParameters\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ Print (L"Please use UEFI Shell to run this application.\n");\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ Argc = ShellParameters->Argc;\r
+ Argv = ShellParameters->Argv;\r
+\r
+ if (Argc < 2) {\r
+ PrintUsage ();\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ if (Argc == 2) {\r
+ if ((StrCmp (Argv[1], L"/?") == 0) ||\r
+ (StrCmp (Argv[1], L"-?") == 0) ||\r
+ (StrCmp (Argv[1], L"-h") == 0) ||\r
+ (StrCmp (Argv[1], L"-H") == 0) ) {\r
+ PrintUsage ();\r
+ return EFI_SUCCESS;\r
+ }\r
+ }\r
+\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiDebuggerConfigurationProtocolGuid,\r
+ NULL,\r
+ (VOID**)&DebuggerConfiguration\r
+ );\r
+ if (EFI_ERROR(Status)) {\r
+ Print (L"Error: DebuggerConfiguration protocol not found.\n");\r
+ return EFI_NOT_FOUND;\r
+ }\r
+\r
+ if (StriCmp (Argv[1], L"SHOWINFO") == 0) {\r
+ EdbShowInfo (DebuggerConfiguration);\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ if (((Argc == 2) || (Argc == 3)) &&\r
+ ((StriCmp (Argv[1], L"BOC") == 0) ||\r
+ (StriCmp (Argv[1], L"BOCX") == 0) ||\r
+ (StriCmp (Argv[1], L"BOR") == 0) ||\r
+ (StriCmp (Argv[1], L"BOE") == 0) ||\r
+ (StriCmp (Argv[1], L"BOT") == 0) ||\r
+ (StriCmp (Argv[1], L"BOK") == 0))) {\r
+ if (Argc == 3) {\r
+ EdbConfigBreak (DebuggerConfiguration, Argv[1], Argv[2]);\r
+ } else {\r
+ EdbConfigBreak (DebuggerConfiguration, Argv[1], NULL);\r
+ }\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ Print (L"Error: Invalid Command.\n");\r
+ return EFI_INVALID_PARAMETER;\r
+}\r
--- /dev/null
+## @file\r
+# EBC Debugger configuration application.\r
+#\r
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = EdbCfg\r
+ MODULE_UNI_FILE = EbcDebuggerConfig.uni\r
+ FILE_GUID = 8CFC5233-23C6-49e3-8A2D-7E581AB305BA\r
+ MODULE_TYPE = UEFI_APPLICATION\r
+ VERSION_STRING = 1.0\r
+ ENTRY_POINT = InitializeEbcDebuggerConfig\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF AARCH64\r
+#\r
+\r
+[Sources]\r
+ EbcDebugger/EbcDebuggerConfig.c\r
+ EbcDebugger/EdbCommon.h\r
+ EbcDebugger/EdbSupportString.c\r
+ EbcDebugger/EdbSupport.h\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ UefiLib\r
+ BaseLib\r
+ DebugLib\r
+ UefiApplicationEntryPoint\r
+\r
+[Protocols]\r
+ gEfiDebuggerConfigurationProtocolGuid ## CONSUMES\r
+ gEfiShellParametersProtocolGuid ## CONSUMES\r
+\r
+[Depex]\r
+ TRUE\r
+\r
+[UserExtensions.TianoCore."ExtraFiles"]\r
+ EbcDebuggerConfigExtra.uni\r