Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>

-----Original Message-----
From: Wang, Sunny (HPS SW) 
Sent: Tuesday, October 27, 2015 4:38 AM
To: [email protected]
Cc: El-Haj-Mahmoud, Samer <[email protected]>; Wang, Sunny (HPS SW) 
<[email protected]>
Subject: [PATCH] MdeModulePkg: Add a BDS platform hook function 
PlatformBootManagerBeforeDefaultBoot to PlatformBootManagerLib

Add a BDS platform hook function PlatformBootManagerBeforeDefaultBoot to 
PlatformBootManagerLib

PlatformBootManagerBeforeDefaultBoot would be helpful for us to do some 
platform actions like printing a specific message on the screen before booting 
the boot devices in boot order and after booting Boot Manager Menu (for OS 
request by setting OsIndications) and Hotkey option.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <[email protected]>
---
 MdeModulePkg/Include/Library/PlatformBootManagerLib.h   | 14 ++++++++++++++
 .../PlatformBootManagerLibNull/PlatformBootManager.c    | 17 +++++++++++++++++
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c                |  9 ++++++++-
 .../PlatformBootManagerLib/PlatformBootManager.c        | 16 ++++++++++++++++
 4 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h 
b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
index 5274503..0380161 100644
--- a/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/PlatformBootManagerLib.h
@@ -3,6 +3,7 @@
   instances to support platform-specific behavior.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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 @@ -59,4 +60,17 @@ 
PlatformBootManagerWaitCallback (
   UINT16          TimeoutRemain
   );
 
+/**
+  Do the platform specific action before default boot behavior.
+
+  Such as:
+    Print specific string
+
+**/
+VOID
+EFIAPI
+PlatformBootManagerBeforeDefaultBoot (
+  VOID
+  );
+
 #endif
diff --git 
a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c 
b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
index 1390e19..34fa4e2 100644
--- a/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManager.c
+++ b/MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManage
+++ r.c
@@ -3,6 +3,7 @@
   by IBV/OEM.
 
 Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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 @@ -65,3 +66,19 @@ 
PlatformBootManagerWaitCallback (  {
   return;
 }
+
+/**
+  Do the platform specific action before default boot behavior.
+
+  Such as:
+    Print specific string
+
+**/
+VOID
+EFIAPI
+PlatformBootManagerBeforeDefaultBoot (
+  VOID
+  )
+{
+  return;
+}
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index c889892..bd9dcab 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -5,8 +5,8 @@
   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be 
invoked
   to enter BDS phase.
 
-(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>  Copyright 
(c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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 @@ -1135,6 +1135,13 
@@ BdsEntry (
     }
   }
 
+  //
+  // Do the platform specific action before default boot behavior  //  
+ PERF_START (NULL, "PlatformBootManagerBeforeDefaultBoot", "BDS", 0);  
+ PlatformBootManagerBeforeDefaultBoot ();
+  PERF_END   (NULL, "PlatformBootManagerBeforeDefaultBoot", "BDS", 0);
+
   while (TRUE) {
     //
     // BDS select the boot device to load OS diff --git 
a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index e944105..4f5bdcd 100644
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -280,3 +280,19 @@ PlatformBootManagerWaitCallback (
     0
     );
 }
+
+/**
+  Do the platform specific action before default boot behavior.
+
+  Such as:
+    Print specific string
+
+**/
+VOID
+EFIAPI
+PlatformBootManagerBeforeDefaultBoot (
+  VOID
+  )
+{
+  return;
+}
--
2.5.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to