[edk2] BaseTools features: multiple workspaces

2015-08-02 Thread Gao, Liming
Hi, all
  We will update BaseTools feature to allow more than one workspaces. The 
detail design in the below. Please help review it. If you have any comments, 
please let me know.

1.   Keep $(WORKSPACE) environment as is

a.   $(WORKSPACE) determines location of Build and Conf directory.

2.   New optional $(WORKSPACE_MULTIPLE) environment is added to include 
more directories with the separator ';', like $(PATH)

a.   Produce the same behavior if $(WORKSPACE_MULTIPLE) is not set.

3.   Update edksetup.bat/edksetup.sh to find BaseTools directory from 
$(WORKSPACE) and $(WORKSPACE_MULTIPLE) directories.

4.   Update BaseTools to support multiple workspaces

a.   For the relative file path (INF, DSC and FDF), BaseTools will search 
them from $(WORKSPACE) and $(WORKSPACE_MULTIPLE) directories.

b.  Search priority from high to low: $(WORKSPACE), $(WORKSPACE_MULTIPLE).

This is a compatible feature. It has no impact on current EDKII project.

Thanks
Liming
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Nt32Pkg: Remove old useless bds platform lib.

2015-08-02 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni ruiyu...@intel.com

 -Original Message-
 From: Dong, Eric
 Sent: Monday, August 3, 2015 10:57 AM
 To: Ni, Ruiyu ruiyu...@intel.com; edk2-devel@lists.01.org
 Subject: [Patch] Nt32Pkg: Remove old useless bds platform lib.
 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Eric Dong eric.d...@intel.com
 ---
  Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c  | 561
 --
  Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h  | 119 ---
  Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf |  63 
  Nt32Pkg/Library/Nt32BdsLib/PlatformData.c | 227 
  Nt32Pkg/Nt32Pkg.dsc   |   1 -
  5 files changed, 971 deletions(-)
  delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
  delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
  delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
  delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/PlatformData.c
 
 diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
 b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
 deleted file mode 100644
 index 0055223..000
 --- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
 +++ /dev/null
 @@ -1,561 +0,0 @@
 -/**@file
 -
 -Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.BR
 -This program and the accompanying materials
 -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
 -http://opensource.org/licenses/bsd-license.php
 -
 -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS
 BASIS,
 -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
 EXPRESS OR IMPLIED.
 -
 -Module Name:
 -
 -  BdsPlatform.c
 -
 -Abstract:
 -
 -  This file include all platform action which can be customized
 -  by IBV/OEM.
 -
 -**/
 -
 -#include BdsPlatform.h
 -
 -WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData;
 -
 -VOID
 -SetupVariableInit (
 -  VOID
 -  )
 -{
 -  EFI_STATUS  Status;
 -  UINTN   Size;
 -
 -  Size = sizeof (mSystemConfigData);
 -  Status = gRT-GetVariable (
 -  LSetup,
 -  gEfiWinNtSystemConfigGuid,
 -  NULL,
 -  Size,
 -  (VOID *) mSystemConfigData
 -  );
 -
 -  if (EFI_ERROR (Status)) {
 -//
 -// SetupVariable is corrupt
 -//
 -mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn);
 -mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow);
 -
 -Status = gRT-SetVariable (
 -LSetup,
 -gEfiWinNtSystemConfigGuid,
 -EFI_VARIABLE_NON_VOLATILE |
 EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
 -sizeof (mSystemConfigData),
 -(VOID *) mSystemConfigData
 -);
 -if (EFI_ERROR (Status)) {
 -  DEBUG ((EFI_D_ERROR, Failed to save Setup Variable to
 non-volatile storage, Status = %r\n, Status));
 -}
 -  }
 -}
 -
 -//
 -// BDS Platform Functions
 -//
 -VOID
 -EFIAPI
 -PlatformBdsInit (
 -  VOID
 -  )
 -/*++
 -
 -Routine Description:
 -
 -  Platform Bds init. Include the platform firmware vendor, revision
 -  and so crc check.
 -
 -Arguments:
 -
 -Returns:
 -
 -  None.
 -
 ---*/
 -{
 -  BdsLibSaveMemoryTypeInformation ();
 -  SetupVariableInit ();
 -}
 -
 -EFI_STATUS
 -PlatformBdsConnectConsole (
 -  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole
 -  )
 -/*++
 -
 -Routine Description:
 -
 -  Connect the predefined platform default console device. Always try to
 find
 -  and enable the vga device if have.
 -
 -Arguments:
 -
 -  PlatformConsole - Predfined platform default console device
 array.
 -
 -Returns:
 -
 -  EFI_SUCCESS - Success connect at least one ConIn and
 ConOut
 -device, there must have one ConOut
 device is
 -active vga device.
 -
 -  EFI_STATUS  - Return the status of
 -BdsLibConnectAllDefaultConsoles ()
 -
 ---*/
 -{
 -  EFI_STATUS  Status;
 -  UINTN   Index;
 -
 -  Index   = 0;
 -  Status  = EFI_SUCCESS;
 -
 -  //
 -  // Have chance to connect the platform default console,
 -  // the platform default console is the minimue device group
 -  // the platform should support
 -  //
 -  while (PlatformConsole[Index].DevicePath != NULL) {
 -//
 -// Update the console variable with the connect type
 -//
 -if ((PlatformConsole[Index].ConnectType  CONSOLE_IN) ==
 CONSOLE_IN) {
 -  BdsLibUpdateConsoleVariable (LConIn,
 PlatformConsole[Index].DevicePath, NULL);
 -}
 -
 -if ((PlatformConsole[Index].ConnectType  CONSOLE_OUT) ==
 CONSOLE_OUT) {
 -  BdsLibUpdateConsoleVariable (LConOut,
 PlatformConsole[Index].DevicePath, NULL);
 -}
 -
 -if ((PlatformConsole[Index].ConnectType  STD_ERROR) ==
 STD_ERROR) {
 -  BdsLibUpdateConsoleVariable (LErrOut,
 

Re: [edk2] BaseTools features: multiple workspaces

2015-08-02 Thread Ni, Ruiyu
Path separator in Linux seems to be :. Will you always use ;?

Thanks,
Ray

 -Original Message-
 From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
 Gao, Liming
 Sent: Monday, August 3, 2015 11:57 AM
 To: edk2-devel@lists.01.org
 Subject: [edk2] BaseTools features: multiple workspaces
 
 Hi, all
   We will update BaseTools feature to allow more than one workspaces.
 The detail design in the below. Please help review it. If you have any
 comments, please let me know.
 
 1.   Keep $(WORKSPACE) environment as is
 
 a.   $(WORKSPACE) determines location of Build and Conf directory.
 
 2.   New optional $(WORKSPACE_MULTIPLE) environment is added to
 include more directories with the separator ';', like $(PATH)
 
 a.   Produce the same behavior if $(WORKSPACE_MULTIPLE) is not
 set.
 
 3.   Update edksetup.bat/edksetup.sh to find BaseTools directory
 from $(WORKSPACE) and $(WORKSPACE_MULTIPLE) directories.
 
 4.   Update BaseTools to support multiple workspaces
 
 a.   For the relative file path (INF, DSC and FDF), BaseTools will search
 them from $(WORKSPACE) and $(WORKSPACE_MULTIPLE) directories.
 
 b.  Search priority from high to low: $(WORKSPACE),
 $(WORKSPACE_MULTIPLE).
 
 This is a compatible feature. It has no impact on current EDKII project.
 
 Thanks
 Liming
 ___
 edk2-devel mailing list
 edk2-devel@lists.01.org
 https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 1/3] ArmVirtPkg: Copy QemuBootOrderLib to ArmVirtPkg

2015-08-02 Thread Ruiyu Ni
Because OvmfPkg will change to use new BDS in MdeModulePkg.
Keep the QemuBootOrderLib which depends on old BDS library in ArmVirtPkg
because ArmVirtPkg are still using old BDS in IntelFrameworkModulePkg.
We can unify the QemuBootOrderLib in future if ArmVirtPkg starts to
use new BDS as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni ruiyu...@intel.com
Cc: Laszlo Ersek ler...@redhat.com
---
 ArmVirtPkg/ArmVirtQemu.dsc |2 +-
 .../Library/QemuBootOrderLib/ExtraRootBusMap.c |  313 
 .../Library/QemuBootOrderLib/ExtraRootBusMap.h |   40 +
 .../Library/QemuBootOrderLib/QemuBootOrderLib.c| 1793 
 .../Library/QemuBootOrderLib/QemuBootOrderLib.inf  |   68 +
 5 files changed, 2215 insertions(+), 1 deletion(-)
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index c199cac..959ac04 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -62,7 +62,7 @@
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   PlatformBdsLib|ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
-  QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
+  QemuBootOrderLib|ArmVirtPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 !endif
 
 [LibraryClasses.common.UEFI_DRIVER]
diff --git a/ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c 
b/ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
new file mode 100644
index 000..ec42214
--- /dev/null
+++ b/ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
@@ -0,0 +1,313 @@
+/** @file
+  Map positions of extra PCI root buses to bus numbers.
+
+  Copyright (C) 2015, Red Hat, Inc.
+
+  This program and the accompanying materials 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
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#include Library/DebugLib.h
+#include Library/DevicePathLib.h
+#include Library/MemoryAllocationLib.h
+#include Library/OrderedCollectionLib.h
+#include Library/UefiBootServicesTableLib.h
+#include Protocol/DevicePath.h
+#include Protocol/PciRootBridgeIo.h
+
+#include ExtraRootBusMap.h
+
+//
+// The BusNumbers field is an array with Count elements. The elements increase
+// strictry monotonically. Zero is not an element (because the zero bus number
+// belongs to the main root bus, never to an extra root bus). Offset N in the
+// array maps the extra root bus with position (N+1) to its bus number (because
+// the root bus with position 0 is always the main root bus, therefore we don't
+// store it).
+//
+// If there are no extra root buses in the system, then Count is 0, and
+// BusNumbers is NULL.
+//
+struct EXTRA_ROOT_BUS_MAP_STRUCT {
+  UINT32 *BusNumbers;
+  UINTN  Count;
+};
+
+
+/**
+  An ORDERED_COLLECTION_USER_COMPARE function that compares root bridge
+  protocol device paths based on UID.
+
+  @param[in] UserStruct1  Pointer to the first ACPI_HID_DEVICE_PATH.
+
+  @param[in] UserStruct2  Pointer to the second ACPI_HID_DEVICE_PATH.
+
+  @retval 0  If UserStruct1 compares less than UserStruct2.
+
+  @retval  0  If UserStruct1 compares equal to UserStruct2.
+
+  @retval 0  If UserStruct1 compares greater than UserStruct2.
+**/
+STATIC
+INTN
+EFIAPI
+RootBridgePathCompare (
+  IN CONST VOID *UserStruct1,
+  IN CONST VOID *UserStruct2
+  )
+{
+  CONST ACPI_HID_DEVICE_PATH *Acpi1;
+  CONST ACPI_HID_DEVICE_PATH *Acpi2;
+
+  Acpi1 = UserStruct1;
+  Acpi2 = UserStruct2;
+
+  return Acpi1-UID  Acpi2-UID ? -1 :
+ Acpi1-UID  Acpi2-UID ?  1 :
+ 0;
+}
+
+
+/**
+  An ORDERED_COLLECTION_KEY_COMPARE function that compares a root bridge
+  protocol device path against a UID.
+
+  @param[in] StandaloneKey  Pointer to the bare UINT32 UID.
+
+  @param[in] UserStruct Pointer to the ACPI_HID_DEVICE_PATH with the
+embedded UINT32 UID.
+
+  @retval 0  If StandaloneKey compares less than UserStruct's key.
+
+  @retval  0  If StandaloneKey compares equal to UserStruct's key.
+
+  @retval 0  If StandaloneKey compares greater than UserStruct's key.
+**/
+STATIC
+INTN
+EFIAPI
+RootBridgePathKeyCompare (
+  IN CONST VOID *StandaloneKey,
+  IN CONST VOID *UserStruct
+  )
+{
+  CONST UINT32   *Uid;
+  CONST ACPI_HID_DEVICE_PATH *Acpi;
+
+  Uid  = StandaloneKey;
+  Acpi = 

[edk2] [Patch 0/3] Use new BDS and UiApp for OvmfPkg

2015-08-02 Thread Ruiyu Ni
A new BDS and UiApp was created in MdeModulePkg and are already
used in Nt32Pkg.
The patch changes the OvmfPkg to use the new BDS and UiApp as well.

Ruiyu Ni (3):
  ArmVirtPkg: Copy QemuBootOrderLib to ArmVirtPkg
  OvmfPkg: use new BDS and UiApp in MdeModulePkg
  OvmfPkg: Remove unused PlatformBdsLib after using new BDS.

 ArmVirtPkg/ArmVirtQemu.dsc |2 +-
 .../Library/QemuBootOrderLib/ExtraRootBusMap.c |  313 
 .../Library/QemuBootOrderLib/ExtraRootBusMap.h |   40 +
 .../Library/QemuBootOrderLib/QemuBootOrderLib.c| 1793 
 .../Library/QemuBootOrderLib/QemuBootOrderLib.inf  |   68 +
 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c   | 1597 -
 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h   |  292 
 OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf  |   72 -
 OvmfPkg/Library/PlatformBdsLib/PlatformData.c  |   51 -
 OvmfPkg/Library/PlatformBdsLib/QemuKernel.c|  170 --
 .../Library/PlatformBootManagerLib/BdsPlatform.c   | 1438 
 .../Library/PlatformBootManagerLib/BdsPlatform.h   |  246 +++
 .../Library/PlatformBootManagerLib/MemoryTest.c|  450 +
 .../PlatformBootManagerLib.inf |   80 +
 .../Library/PlatformBootManagerLib/PlatformData.c  |   35 +
 .../Library/PlatformBootManagerLib/QemuKernel.c|  170 ++
 OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c |  673 
 OvmfPkg/Library/PlatformBootManagerLib/Strings.uni |  Bin 0 - 3658 bytes
 .../Library/QemuBootOrderLib/QemuBootOrderLib.c|  355 ++--
 .../Library/QemuBootOrderLib/QemuBootOrderLib.inf  |4 +-
 OvmfPkg/OvmfPkg.dec|5 +-
 OvmfPkg/OvmfPkgIa32.dsc|   28 +-
 OvmfPkg/OvmfPkgIa32.fdf|3 +-
 OvmfPkg/OvmfPkgIa32X64.dsc |   30 +-
 OvmfPkg/OvmfPkgIa32X64.fdf |3 +-
 OvmfPkg/OvmfPkgX64.dsc |   28 +-
 OvmfPkg/OvmfPkgX64.fdf |3 +-
 27 files changed, 5604 insertions(+), 2345 deletions(-)
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.c
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
 create mode 100644 ArmVirtPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/PlatformData.c
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/QemuKernel.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/MemoryTest.c
 create mode 100644 
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/Strings.uni

-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch 3/3] OvmfPkg: Remove unused PlatformBdsLib after using new BDS.

2015-08-02 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni ruiyu...@intel.com
Cc: Jordan Justen jordan.l.jus...@intel.com
Cc: Laszlo Ersek ler...@redhat.com
---
 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c  | 1597 -
 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h  |  292 
 OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf |   72 -
 OvmfPkg/Library/PlatformBdsLib/PlatformData.c |   51 -
 OvmfPkg/Library/PlatformBdsLib/QemuKernel.c   |  170 ---
 5 files changed, 2182 deletions(-)
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.h
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/PlatformData.c
 delete mode 100644 OvmfPkg/Library/PlatformBdsLib/QemuKernel.c

diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c 
b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
deleted file mode 100644
index 0abba98..000
--- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
+++ /dev/null
@@ -1,1597 +0,0 @@
-/** @file
-  Platform BDS customizations.
-
-  Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.BR
-  This program and the accompanying materials
-  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
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include BdsPlatform.h
-#include Library/QemuBootOrderLib.h
-
-
-//
-// Global data
-//
-
-VOID  *mEfiDevPathNotifyReg;
-EFI_EVENT mEfiDevPathEvent;
-VOID  *mEmuVariableEventReg;
-EFI_EVENT mEmuVariableEvent;
-BOOLEAN   mDetectVgaOnly;
-UINT16mHostBridgeDevId;
-
-//
-// Table of host IRQs matching PCI IRQs A-D
-// (for configuring PCI Interrupt Line register)
-//
-CONST UINT8 PciHostIrqs[] = {
-  0x0a, 0x0a, 0x0b, 0x0b
-};
-
-//
-// Array Size macro
-//
-#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
-
-//
-// Type definitions
-//
-
-typedef
-EFI_STATUS
-(EFIAPI *PROTOCOL_INSTANCE_CALLBACK)(
-  IN EFI_HANDLE   Handle,
-  IN VOID *Instance,
-  IN VOID *Context
-  );
-
-/**
-  @param[in]  Handle - Handle of PCI device instance
-  @param[in]  PciIo - PCI IO protocol instance
-  @param[in]  Pci - PCI Header register block
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VISIT_PCI_INSTANCE_CALLBACK)(
-  IN EFI_HANDLE   Handle,
-  IN EFI_PCI_IO_PROTOCOL  *PciIo,
-  IN PCI_TYPE00   *Pci
-  );
-
-
-//
-// Function prototypes
-//
-
-EFI_STATUS
-VisitAllInstancesOfProtocol (
-  IN EFI_GUID*Id,
-  IN PROTOCOL_INSTANCE_CALLBACK  CallBackFunction,
-  IN VOID*Context
-  );
-
-EFI_STATUS
-VisitAllPciInstancesOfProtocol (
-  IN VISIT_PCI_INSTANCE_CALLBACK CallBackFunction
-  );
-
-VOID
-InstallDevicePathCallback (
-  VOID
-  );
-
-//
-// BDS Platform Functions
-//
-VOID
-EFIAPI
-PlatformBdsInit (
-  VOID
-  )
-/*++
-
-Routine Description:
-
-  Platform Bds init. Incude the platform firmware vendor, revision
-  and so crc check.
-
-Arguments:
-
-Returns:
-
-  None.
-
---*/
-{
-  DEBUG ((EFI_D_INFO, PlatformBdsInit\n));
-  InstallDevicePathCallback ();
-}
-
-
-EFI_STATUS
-EFIAPI
-ConnectRootBridge (
-  IN EFI_HANDLE  RootBridgeHandle,
-  IN VOID*Instance,
-  IN VOID*Context
-  )
-{
-  EFI_STATUS Status;
-
-  //
-  // Make the PCI bus driver connect the root bridge, non-recursively. This
-  // will produce a number of child handles with PciIo on them.
-  //
-  Status = gBS-ConnectController (
-  RootBridgeHandle, // ControllerHandle
-  NULL, // DriverImageHandle
-  NULL, // RemainingDevicePath -- produce all
-//   children
-  FALSE // Recursive
-  );
-  return Status;
-}
-
-
-EFI_STATUS
-PrepareLpcBridgeDevicePath (
-  IN EFI_HANDLEDeviceHandle
-  )
-/*++
-
-Routine Description:
-
-  Add IsaKeyboard to ConIn,
-  add IsaSerial to ConOut, ConIn, ErrOut.
-  LPC Bridge: 06 01 00
-
-Arguments:
-
-  DeviceHandle- Handle of PCIIO protocol.
-
-Returns:
-
-  EFI_SUCCESS - LPC bridge is added to ConOut, ConIn, and ErrOut.
-  EFI_STATUS  - No LPC bridge is added.
-
---*/
-{
-  EFI_STATUSStatus;
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
-  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;
-  CHAR16*DevPathStr;
-
-  DevicePath = NULL;
-  Status = gBS-HandleProtocol (
-  DeviceHandle,
-  gEfiDevicePathProtocolGuid,
-  (VOID*)DevicePath
-  );
-  if (EFI_ERROR 

[edk2] [Patch 2/3] OvmfPkg: use new BDS and UiApp in MdeModulePkg

2015-08-02 Thread Ruiyu Ni
Compare to the old BDS, the new BDS separates the UI part to a standalone
application UiApp.
QemuBootOrderLib was changed to depend on the UefiBootManagerLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni ruiyu...@intel.com
Cc: Jordan Justen jordan.l.jus...@intel.com
Cc: Laszlo Ersek ler...@redhat.com
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c   | 1438 
 .../Library/PlatformBootManagerLib/BdsPlatform.h   |  246 
 .../Library/PlatformBootManagerLib/MemoryTest.c|  450 ++
 .../PlatformBootManagerLib.inf |   80 ++
 .../Library/PlatformBootManagerLib/PlatformData.c  |   35 +
 .../Library/PlatformBootManagerLib/QemuKernel.c|  170 +++
 OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c |  673 +
 OvmfPkg/Library/PlatformBootManagerLib/Strings.uni |  Bin 0 - 3658 bytes
 .../Library/QemuBootOrderLib/QemuBootOrderLib.c|  355 +++--
 .../Library/QemuBootOrderLib/QemuBootOrderLib.inf  |4 +-
 OvmfPkg/OvmfPkg.dec|5 +-
 OvmfPkg/OvmfPkgIa32.dsc|   28 +-
 OvmfPkg/OvmfPkgIa32.fdf|3 +-
 OvmfPkg/OvmfPkgIa32X64.dsc |   30 +-
 OvmfPkg/OvmfPkgIa32X64.fdf |3 +-
 OvmfPkg/OvmfPkgX64.dsc |   28 +-
 OvmfPkg/OvmfPkgX64.fdf |3 +-
 17 files changed, 3389 insertions(+), 162 deletions(-)
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/MemoryTest.c
 create mode 100644 
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c
 create mode 100644 OvmfPkg/Library/PlatformBootManagerLib/Strings.uni

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c 
b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
new file mode 100644
index 000..3488316
--- /dev/null
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -0,0 +1,1438 @@
+/** @file
+  Platform BDS customizations.
+
+  Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.BR
+  This program and the accompanying materials
+  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
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include BdsPlatform.h
+#include Library/QemuBootOrderLib.h
+#include Library/DevicePathLib.h
+#include Protocol/LoadedImage.h
+
+
+//
+// Global data
+//
+
+VOID  *mEfiDevPathNotifyReg;
+EFI_EVENT mEfiDevPathEvent;
+VOID  *mEmuVariableEventReg;
+EFI_EVENT mEmuVariableEvent;
+BOOLEAN   mDetectVgaOnly;
+UINT16mHostBridgeDevId;
+
+//
+// Table of host IRQs matching PCI IRQs A-D
+// (for configuring PCI Interrupt Line register)
+//
+CONST UINT8 PciHostIrqs[] = {
+  0x0a, 0x0a, 0x0b, 0x0b
+};
+
+//
+// Array Size macro
+//
+#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
+
+//
+// Type definitions
+//
+
+typedef
+EFI_STATUS
+(EFIAPI *PROTOCOL_INSTANCE_CALLBACK)(
+  IN EFI_HANDLE   Handle,
+  IN VOID *Instance,
+  IN VOID *Context
+  );
+
+/**
+  @param[in]  Handle - Handle of PCI device instance
+  @param[in]  PciIo - PCI IO protocol instance
+  @param[in]  Pci - PCI Header register block
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VISIT_PCI_INSTANCE_CALLBACK)(
+  IN EFI_HANDLE   Handle,
+  IN EFI_PCI_IO_PROTOCOL  *PciIo,
+  IN PCI_TYPE00   *Pci
+  );
+
+
+//
+// Function prototypes
+//
+
+EFI_STATUS
+VisitAllInstancesOfProtocol (
+  IN EFI_GUID*Id,
+  IN PROTOCOL_INSTANCE_CALLBACK  CallBackFunction,
+  IN VOID*Context
+  );
+
+EFI_STATUS
+VisitAllPciInstancesOfProtocol (
+  IN VISIT_PCI_INSTANCE_CALLBACK CallBackFunction
+  );
+
+VOID
+InstallDevicePathCallback (
+  VOID
+  );
+
+/**
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the 
+  OptionType, Attributes, Description, FilePath and OptionalData are equal.
+
+  @param KeyPointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1  Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+PlatformFindLoadOption (
+  IN CONST 

Re: [edk2] [PATCH v4 00/13] BaseTools: unify all GCC linker scripts

2015-08-02 Thread Liu, Yingke D
Hi Ard,

Sorry for delaying reply, please go ahead, If Liming agreed BaseTools' patches, 
you could commit them without my feedback.

Thanks,
Dennis

-Original Message-
From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
Sent: Friday, July 31, 2015 19:05
To: edk2-devel@lists.01.org; Justen, Jordan L; Liu, Yingke D; Gao, Liming
Cc: Laszlo Ersek; Leif Lindholm; Ard Biesheuvel
Subject: Re: [PATCH v4 00/13] BaseTools: unify all GCC linker scripts

On 30 July 2015 at 16:16, Ard Biesheuvel ard.biesheu...@linaro.org wrote:
 Fourth attempt at unifying the various GCC linker scripts for 
 different architectures, GCC versions and minimum alignments.

 Changes since v3:
 - added patch #5 which updates the various IA32/X86 linker scripts to take 
 their
   PE/COFF header size and section alignment from the command line, before
   switching to the unified version which does the same
 - added Jordan's Reviewed-by, which he gave on the condition that patch #5
   be added
 - added Liming's Tested-by to the patches that apply to IA32 and X86
 - added Leif's Tested-by to the patches that apply to AARCH64 (except the
   ArmVirtPkg which he didn't test, but this was my testbed during 
 development)

 Changes since v2:
 - for easier bisection, factor out the differences between the original
   and the unified linker scripts for X86 before making the switch
   (patches #1 - #4 and #6)
 - add Intel copyright notice to unified version (patch #5)
 - avoid defining *_*_*_DLINK2_FLAGS so that we don't pollute the variable
   definition space of non-GCC toolchains (patches #8 and #12)
 - added Laszlo's ack to patch #10

  v2 blurb 
 - This time, I have added only a 
 single unified GCC linker script that can be parametrised by ld command line 
 options:
 - --defsym=PECOFF_HEADER_SIZE sets the size of the PE/COFF header
 - -z common-page-size sets the minimum alignment

 This use of common-page-size is entirely legal: it sets an internal LD 
 constant which can be referred to as CONSTANT(COMMONPAGESIZE) in 
 linker scripts, and is otherwise unused internally by the linker.

 Tested with ArmVirtQemu/AARCH64 and Ovmf/X64

 Branch is here
 https://git.linaro.org/people/ard.biesheuvel/uefi-next.git/shortlog/re
 fs/heads/unify-gcc-ld-scripts-v4 (now correctly based on the GitHub 
 repo)


@Liming, Jordan:
now that everybody seems ok with these patches, can I go ahead and commit them?
I did not receive any feedback from Dennis, who is listed in Maintainers.txt as 
the sole maintainer of BaseTools/

Thanks,
Ard.



 Ard Biesheuvel (13):
   BaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker
 scripts
   BaseTools IA32/X64: move .rodata to PE/COFF .text section
   BaseTools IA32/X64: drop redundant alignment from linker script
   BaseTools IA32/X64: move .got contents to the PE/COFF .text section
   BaseTools IA32/X64: get header size and alignment from ld commandline
   BaseTools GCC: add unified GCC linker script for all archs and
 versions
   BaseTools GCC: align start of .data to .text alignment
   BaseTools GCC: move AutoGen.obj contents to .text section
   BaseTools AARCH64: move to unified GCC linker script
   ArmPlatformPkg/ArmVExpressPkg: move to unified GCC linker script
   ArmVirtPkg: move to unified GCC linker script
   BaseTools AARCH64: remove incremental linker script for 64K alignment
   BaseTools IA32/X64: Use GccBase.lds instead of gcc*-ld-script

  ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc |  2 +-
  ArmVirtPkg/ArmVirt.dsc.inc|  2 +-
  BaseTools/Conf/tools_def.template | 37 ++-
  BaseTools/Scripts/GccBase.lds | 70 
  BaseTools/Scripts/gcc-4K-align-ld-script  | 44 
  BaseTools/Scripts/gcc-aarch64-64K-align-ld-script |  4 --
  BaseTools/Scripts/gcc-aarch64-ld-script   | 39 ---
  BaseTools/Scripts/gcc4.4-ld-script| 44 
  BaseTools/Scripts/gcc4.9-ld-script| 44 
  9 files changed, 106 insertions(+), 180 deletions(-)  create mode 
 100644 BaseTools/Scripts/GccBase.lds  delete mode 100644 
 BaseTools/Scripts/gcc-4K-align-ld-script
  delete mode 100644 BaseTools/Scripts/gcc-aarch64-64K-align-ld-script
  delete mode 100644 BaseTools/Scripts/gcc-aarch64-ld-script
  delete mode 100644 BaseTools/Scripts/gcc4.4-ld-script
  delete mode 100644 BaseTools/Scripts/gcc4.9-ld-script

 --
 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools/build_rule: Added --trim-long option.

2015-08-02 Thread Gao, Liming
Reviewed-by: Liming Gao liming@intel.com

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yingke 
Liu
Sent: Monday, August 03, 2015 10:46 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch] BaseTools/build_rule: Added --trim-long option.

asm and asm16 need to trim ULL suffix number.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu yingke.d@intel.com
---
 BaseTools/Conf/build_rule.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Conf/build_rule.template 
b/BaseTools/Conf/build_rule.template
index 596d41d..1035025 100644
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -185,7 +185,7 @@
 
 Command.MSFT, Command.INTEL
 $(PP) $(PP_FLAGS) $(INC) ${src}  ${d_path}(+)${s_base}.i
-Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii 
${d_path}(+)${s_base}.i
+Trim --source-code --convert-hex --trim-long -o 
${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
 $(ASM) /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) 
${d_path}(+)${s_base}.iii
 
 Command.GCC, Command.RVCT
@@ -460,7 +460,7 @@
 
 Command.MSFT, Command.INTEL
 $(PP) $(PP_FLAGS) $(INC) ${src}  ${d_path}(+)${s_base}.i
-Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii 
${d_path}(+)${s_base}.i
+Trim --source-code --convert-hex --trim-long -o 
${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
 cd $(OUTPUT_DIR)(+)${s_dir}
 $(ASM16) /nologo /c /omf $(INC) 
/Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
 $(ASMLINK) $(ASMLINK_FLAGS) 
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst}
-- 
1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] MdeModulePkg DxeCore: Move ProcessLibraryConstructorList()

2015-08-02 Thread Star Zeng
to right after CoreInitializeGcdServices().

Why?
Some platforms maybe report both below 4G and above 4G memory resource hob as 
tested,
then CoreInitializeMemoryServices() will find and add the tested above 4G 
memory resource hob to memory descriptor for early memory allocation services,
then if ProcessLibraryConstructorList() that has library constructor tries to 
allocate below 4G memory and will fail.
In fact, the following CoreInitializeGcdServices() will add all the memory 
resource hob to GCD map,
and add the tested below 4G memory resource hob to memory descriptor,
but it has been too late for ProcessLibraryConstructorList().

Also move below two lines as they are needed to be after
the constructor of DxeCorePerfomanceLib.
  PERF_END   (NULL,PEI, NULL, 0) ;
  PERF_START (NULL,DXE, NULL, 0) ;

Cc: Liming Gao liming@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng star.z...@intel.com
---
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c 
b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index e6ed247..e60d2f2 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -290,13 +290,6 @@ DxeMain (
   ASSERT_EFI_ERROR (Status);
 
   //
-  // Call constructor for all libraries
-  //
-  ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
-  PERF_END   (NULL,PEI, NULL, 0) ;
-  PERF_START (NULL,DXE, NULL, 0) ;
-
-  //
   // Report DXE Core image information to the PE/COFF Extra Action Library
   //
   ZeroMem (ImageContext, sizeof (ImageContext));
@@ -311,6 +304,13 @@ DxeMain (
   ASSERT_EFI_ERROR (Status);
 
   //
+  // Call constructor for all libraries
+  //
+  ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
+  PERF_END   (NULL,PEI, NULL, 0) ;
+  PERF_START (NULL,DXE, NULL, 0) ;
+
+  //
   // Install the DXE Services Table into the EFI System Tables's Configuration 
Table
   //
   Status = CoreInstallConfigurationTable (gEfiDxeServicesTableGuid, 
gDxeCoreDS);
-- 
1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] Nt32Pkg: Remove old useless bds platform lib.

2015-08-02 Thread Eric Dong
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong eric.d...@intel.com
---
 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c  | 561 --
 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h  | 119 ---
 Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf |  63 
 Nt32Pkg/Library/Nt32BdsLib/PlatformData.c | 227 
 Nt32Pkg/Nt32Pkg.dsc   |   1 -
 5 files changed, 971 deletions(-)
 delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
 delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
 delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
 delete mode 100644 Nt32Pkg/Library/Nt32BdsLib/PlatformData.c

diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c 
b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
deleted file mode 100644
index 0055223..000
--- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
+++ /dev/null
@@ -1,561 +0,0 @@
-/**@file
-
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.BR
-This program and the accompanying materials  
-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
-http://opensource.org/licenses/bsd-license.php 
   
-   
   
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS,  
   
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.  
   
-
-Module Name:
-
-  BdsPlatform.c
-
-Abstract:
-
-  This file include all platform action which can be customized
-  by IBV/OEM.
-
-**/
-
-#include BdsPlatform.h
-
-WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData;
-
-VOID
-SetupVariableInit (
-  VOID
-  )
-{
-  EFI_STATUS  Status;
-  UINTN   Size;
-
-  Size = sizeof (mSystemConfigData);
-  Status = gRT-GetVariable (
-  LSetup,
-  gEfiWinNtSystemConfigGuid,
-  NULL,
-  Size,
-  (VOID *) mSystemConfigData
-  );
-
-  if (EFI_ERROR (Status)) {
-//
-// SetupVariable is corrupt
-//
-mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn);
-mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow);
-
-Status = gRT-SetVariable (
-LSetup,
-gEfiWinNtSystemConfigGuid,
-EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
-sizeof (mSystemConfigData),
-(VOID *) mSystemConfigData
-);
-if (EFI_ERROR (Status)) {
-  DEBUG ((EFI_D_ERROR, Failed to save Setup Variable to non-volatile 
storage, Status = %r\n, Status));
-}
-  }
-}
-
-//
-// BDS Platform Functions
-//
-VOID
-EFIAPI
-PlatformBdsInit (
-  VOID
-  )
-/*++
-
-Routine Description:
-
-  Platform Bds init. Include the platform firmware vendor, revision
-  and so crc check.
-
-Arguments:
-
-Returns:
-
-  None.
-
---*/
-{
-  BdsLibSaveMemoryTypeInformation ();
-  SetupVariableInit ();
-}
-
-EFI_STATUS
-PlatformBdsConnectConsole (
-  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole
-  )
-/*++
-
-Routine Description:
-
-  Connect the predefined platform default console device. Always try to find
-  and enable the vga device if have.
-
-Arguments:
-
-  PlatformConsole - Predfined platform default console device array.
- 
-Returns:
-
-  EFI_SUCCESS - Success connect at least one ConIn and ConOut 
-device, there must have one ConOut device is 
-active vga device.
-  
-  EFI_STATUS  - Return the status of 
-BdsLibConnectAllDefaultConsoles ()
-
---*/
-{
-  EFI_STATUS  Status;
-  UINTN   Index;
-
-  Index   = 0;
-  Status  = EFI_SUCCESS;
-
-  //
-  // Have chance to connect the platform default console,
-  // the platform default console is the minimue device group
-  // the platform should support
-  //
-  while (PlatformConsole[Index].DevicePath != NULL) {
-//
-// Update the console variable with the connect type
-//
-if ((PlatformConsole[Index].ConnectType  CONSOLE_IN) == CONSOLE_IN) {
-  BdsLibUpdateConsoleVariable (LConIn, 
PlatformConsole[Index].DevicePath, NULL);
-}
-
-if ((PlatformConsole[Index].ConnectType  CONSOLE_OUT) == CONSOLE_OUT) {
-  BdsLibUpdateConsoleVariable (LConOut, 
PlatformConsole[Index].DevicePath, NULL);
-}
-
-if ((PlatformConsole[Index].ConnectType  STD_ERROR) == STD_ERROR) {
-  BdsLibUpdateConsoleVariable (LErrOut, 
PlatformConsole[Index].DevicePath, NULL);
-}
-
-Index++;
-  }
-  //
-  // Connect the all the default console with current cosole variable
-  //
-  Status = BdsLibConnectAllDefaultConsoles ();
-  
-  

[edk2] [Patch] Nt32Pkg: Do the connect all and Refresh boot option after console is connected.

2015-08-02 Thread Eric Dong
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong eric.d...@intel.com
---
 Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 60d0126..a527a42 100644
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -195,10 +195,12 @@ VOID
 EFIAPI
 PlatformBootManagerAfterConsole (
   VOID
   )
 {
+  EfiBootManagerConnectAll ();
+  EfiBootManagerRefreshAllBootOption ();
   Print (
 L\n
 LF2to enter Boot Manager Menu.\n
 LEnter to boot directly.\n
 L\n
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg DxeCore: Move ProcessLibraryConstructorList()

2015-08-02 Thread Gao, Liming
Reviewed-by: Liming Gao liming@intel.com

-Original Message-
From: Zeng, Star 
Sent: Monday, August 03, 2015 10:57 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming
Subject: [PATCH] MdeModulePkg DxeCore: Move ProcessLibraryConstructorList()

to right after CoreInitializeGcdServices().

Why?
Some platforms maybe report both below 4G and above 4G memory resource hob as 
tested, then CoreInitializeMemoryServices() will find and add the tested above 
4G memory resource hob to memory descriptor for early memory allocation 
services, then if ProcessLibraryConstructorList() that has library constructor 
tries to allocate below 4G memory and will fail.
In fact, the following CoreInitializeGcdServices() will add all the memory 
resource hob to GCD map, and add the tested below 4G memory resource hob to 
memory descriptor, but it has been too late for ProcessLibraryConstructorList().

Also move below two lines as they are needed to be after the constructor of 
DxeCorePerfomanceLib.
  PERF_END   (NULL,PEI, NULL, 0) ;
  PERF_START (NULL,DXE, NULL, 0) ;

Cc: Liming Gao liming@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng star.z...@intel.com
---
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c 
b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index e6ed247..e60d2f2 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -290,13 +290,6 @@ DxeMain (
   ASSERT_EFI_ERROR (Status);
 
   //
-  // Call constructor for all libraries
-  //
-  ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
-  PERF_END   (NULL,PEI, NULL, 0) ;
-  PERF_START (NULL,DXE, NULL, 0) ;
-
-  //
   // Report DXE Core image information to the PE/COFF Extra Action Library
   //
   ZeroMem (ImageContext, sizeof (ImageContext)); @@ -311,6 +304,13 @@ DxeMain 
(
   ASSERT_EFI_ERROR (Status);
 
   //
+  // Call constructor for all libraries  //  
+ ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);
+  PERF_END   (NULL,PEI, NULL, 0) ;
+  PERF_START (NULL,DXE, NULL, 0) ;
+
+  //
   // Install the DXE Services Table into the EFI System Tables's Configuration 
Table
   //
   Status = CoreInstallConfigurationTable (gEfiDxeServicesTableGuid, 
gDxeCoreDS);
--
1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel