VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c@ 80924

Last change on this file since 80924 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/** @file
2 Main file for Reconnect shell Driver1 function.
3
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
6 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#include "UefiShellDriver1CommandsLib.h"
12
13STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
14 {L"-r", TypeFlag},
15 {NULL, TypeMax}
16 };
17
18/**
19 Connect all the possible console devices.
20
21**/
22VOID
23ConnectAllConsoles (
24 VOID
25 )
26{
27 ShellConnectFromDevPaths(L"ConInDev");
28 ShellConnectFromDevPaths(L"ConOutDev");
29 ShellConnectFromDevPaths(L"ErrOutDev");
30
31 ShellConnectFromDevPaths(L"ErrOut");
32 ShellConnectFromDevPaths(L"ConIn");
33 ShellConnectFromDevPaths(L"ConOut");
34}
35
36
37/**
38 Function for 'reconnect' command.
39
40 @param[in] ImageHandle Handle to the Image (NULL if Internal).
41 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
42**/
43SHELL_STATUS
44EFIAPI
45ShellCommandRunReconnect (
46 IN EFI_HANDLE ImageHandle,
47 IN EFI_SYSTEM_TABLE *SystemTable
48 )
49{
50 SHELL_STATUS ShellStatus;
51 LIST_ENTRY *Package;
52 CHAR16 *ProblemParam;
53 EFI_STATUS Status;
54
55 gInReconnect = TRUE;
56 ShellStatus = SHELL_SUCCESS;
57
58 //
59 // initialize the shell lib (we must be in non-auto-init...)
60 //
61 Status = ShellInitialize();
62 ASSERT_EFI_ERROR(Status);
63
64 Status = CommandInit();
65 ASSERT_EFI_ERROR(Status);
66
67 //
68 // parse the command line
69 //
70 Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
71 if (EFI_ERROR(Status)) {
72 if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
73 ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"reconnect", ProblemParam);
74 FreePool(ProblemParam);
75 ShellStatus = SHELL_INVALID_PARAMETER;
76 } else {
77 ASSERT(FALSE);
78 }
79 } else {
80 ShellStatus = ShellCommandRunDisconnect(ImageHandle, SystemTable);
81 if (ShellStatus == SHELL_SUCCESS) {
82 if (ShellCommandLineGetFlag(Package, L"-r")) {
83 ConnectAllConsoles();
84 }
85 ShellStatus = ShellCommandRunConnect(ImageHandle, SystemTable);
86 }
87 }
88
89 gInReconnect = FALSE;
90
91 return (ShellStatus);
92}
93
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette