06808e8 ArmVirtualizationPkg: PlatformIntelBdsLib: fix multiconsole setup

Authored and Committed by lersek 9 years ago
    ArmVirtualizationPkg: PlatformIntelBdsLib: fix multiconsole setup
    
    In the following call chain:
    
    PlatformBdsPolicyBehavior()
      PlatformBdsConnectConsole()
        InitializeConsolePipe() x 3
          BdsConnectDevicePath() [ArmPkg/Library/BdsLib/BdsFilePath.c]
    
    the three InitializeConsolePipe() function calls pass through
    - (&gST->ConsoleOutHandle, &gST->ConOut),
    - (&gST->ConsoleInHandle, &gST->ConIn),
    - (&gST->StandardErrorHandle, &gST->StdErr)
    
    to BdsConnectDevicePath(), in ArmPkg's BdsLib.
    
    At least when more than one console device paths are specified in the
    ConIn / ConOut / ErrOut variables, the above resuls in:
    - unchanged protocol interfaces (ConOut, ConIn, StdErr) in the system
      table (because ConSplitterDxe installs its non-NULL interfaces first),
    - but, changed handles in the system table.
    
    This effectively separates the handle fields in the system table from the
    protocol interfaces in the same that should always be associated with the
    handles. The end result is that clients using the handles break (splitting
    / multiplexing doesn't work for them), while clients directly using the
    protocol interfaces work.
    
    Therefore, do not attempt to connect consoles separately. ConSplitterDxe
    is dispatched before PlatformBdsPolicyBehavior() is called (the latter
    happens in the BDS phase), and ConSplitterDxe installs virtual handles and
    protocol interfaces for input / output / error.
    
    BdsLibConnectAll() covers all devices, including consoles; as those
    consoles are connected, ConPlatformDxe and ConSplitterDxe pick them up
    nicely as "slaves". We just need to make sure that the variables are set
    first, for the variables -> ConPlatformDxe -> ConSplitterDxe dependency
    chain.
    
    Contributed-under: TianoCore Contribution Agreement 1.0
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>