Updates the logic to allow devices to support SFO output mode

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15760 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jaben Carsey 2014-08-05 23:17:18 +00:00 committed by jcarsey
parent ae315cc269
commit 477a79e1eb
2 changed files with 36 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main file for devices shell Driver1 function. Main file for devices shell Driver1 function.
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -203,8 +203,11 @@ ShellCommandRunDevices (
// //
// Print Header // Print Header
// only in non SFO mode.
// //
if (!ShellCommandLineGetFlag(Package, L"-sfo")){
ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle); ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
}
// //
// loop through each handle // loop through each handle
@ -222,11 +225,12 @@ ShellCommandRunDevices (
Name = NULL; Name = NULL;
Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language); Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language);
if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) { if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) {
if (!ShellCommandLineGetFlag(Package, L"-sfo")){
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
Language, Language,
STRING_TOKEN (STR_DEVICES_ITEM_LINE), STRING_TOKEN(STR_DEVICES_ITEM_LINE),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(*HandleListWalker), ConvertHandleToHandleIndex(*HandleListWalker),
Type, Type,
@ -235,7 +239,23 @@ ShellCommandRunDevices (
Parents, Parents,
Devices, Devices,
Children, Children,
Name!=NULL?Name:L"<UNKNOWN>"); Name != NULL ? Name : L"<UNKNOWN>");
} else {
ShellPrintHiiEx(
-1,
-1,
Language,
STRING_TOKEN(STR_DEVICES_ITEM_LINE_SFO),
gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(*HandleListWalker),
Type,
Cfg?L'Y':L'N',
Diag?L'Y':L'N',
Parents,
Devices,
Children,
Name != NULL ? Name : L"<UNKNOWN>");
}
} }
if (Name != NULL) { if (Name != NULL) {
FreePool(Name); FreePool(Name);