]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: new PlatformHookLib library with depex of SerialPortPpi.
authorGao, Liming <liming.gao@intel.com>
Mon, 11 Aug 2014 06:23:51 +0000 (06:23 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Aug 2014 06:23:51 +0000 (06:23 +0000)
 This library has one depex of SerialPortPpi. Then, the PEIM linked it has this depex so that it is dispatched after SerialPortPpi is installed. SerialPortPpi notifies the platform initialization done, then serial port will work.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Kinney, Michael D <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15782 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Ppi/SerialPortPei.h [new file with mode: 0644]
MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.c [new file with mode: 0644]
MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.inf [new file with mode: 0644]
MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.uni [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.dsc

diff --git a/MdeModulePkg/Include/Ppi/SerialPortPei.h b/MdeModulePkg/Include/Ppi/SerialPortPei.h
new file mode 100644 (file)
index 0000000..88fcbf6
--- /dev/null
@@ -0,0 +1,26 @@
+/** @file\r
+  PPI that is installed after the initialization of a serial stream device \r
+  is complete.  \r
+\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _PEI_SERIAL_PORT_PPI_H\r
+#define _PEI_SERIAL_PORT_PPI_H\r
+\r
+#define PEI_SERIAL_PORT_PPI \\r
+  { \\r
+    0x490e9d85, 0x8aef, 0x4193, { 0x8e, 0x56, 0xf7, 0x34, 0xa9, 0xff, 0xac, 0x8b } \\r
+  }\r
+\r
+extern EFI_GUID gPeiSerialPortPpiGuid;\r
+\r
+#endif\r
diff --git a/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.c b/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.c
new file mode 100644 (file)
index 0000000..00b70c7
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  Null Platform Hook Library instance with dependency on gPeiSerialPortPpiGuid\r
+\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Base.h>\r
+#include <Library/PlatformHookLib.h>\r
+\r
+/**\r
+  Performs platform specific initialization required for the CPU to access\r
+  the hardware associated with a SerialPortLib instance.  This function does\r
+  not initialize the serial port hardware itself.  Instead, it initializes\r
+  hardware devices that are required for the CPU to access the serial port\r
+  hardware.  This function may be called more than once.\r
+\r
+  @retval RETURN_SUCCESS       The platform specific initialization succeeded.\r
+  @retval RETURN_DEVICE_ERROR  The platform specific initialization could not be completed.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PlatformHookSerialPortInitialize (\r
+  VOID\r
+  )\r
+{\r
+  return RETURN_SUCCESS;\r
+}\r
diff --git a/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.inf b/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.inf
new file mode 100644 (file)
index 0000000..54aa894
--- /dev/null
@@ -0,0 +1,38 @@
+## @file\r
+#  Null Platform Hook Library instance with dependency on gPeiSerialPortPpiGuid\r
+#\r
+#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PlatformHookLibSerialPortPpi\r
+  FILE_GUID                      = 621734D8-8B5E-4c01-B330-9F89A1081710\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PlatformHookLibSerialPortPpi\r
+  MODULE_UNI_FILE                = PlatformHookLibSerialPortPpi.uni\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources]\r
+  PlatformHookLibSerialPortPpi.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+\r
+[Depex.common.PEIM]\r
+  gPeiSerialPortPpiGuid\r
diff --git a/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.uni b/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.uni
new file mode 100644 (file)
index 0000000..fa5a1a8
Binary files /dev/null and b/MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.uni differ
index d1190b9602413968d6c814b78777f80c2523ed2a..87121a8d83703c7a40ed5de25cf4d2bd50b26e55 100644 (file)
   ## Include/Ppi/PostBootScriptTable.h\r
   gPeiPostScriptTablePpiGuid    =  { 0x88c9d306, 0x900, 0x4eb5, { 0x82, 0x60, 0x3e, 0x2d, 0xbe, 0xda, 0x1f, 0x89}}\r
 \r
+  ## Include/Ppi/SerialPortPei.h\r
+  gPeiSerialPortPpiGuid         =  { 0x490e9d85, 0x8aef, 0x4193, { 0x8e, 0x56, 0xf7, 0x34, 0xa9, 0xff, 0xac, 0x8b}}\r
+\r
 [Protocols]\r
   ## Load File protocol provides capability to load and unload EFI image into memory and execute it.\r
   #  Include/Protocol/LoadPe32Image.h\r
index 1abff59075a1412ba7e4c7c655ecef01fb51f3c7..fd32551d77258d12ad52222a6139448a7ebb0ab5 100644 (file)
   MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.inf\r
   MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
+  MdeModulePkg/Library/PlatformHookLibSerialPortPpi/PlatformHookLibSerialPortPpi.inf\r
 \r
   MdeModulePkg/Universal/CapsulePei/CapsulePei.inf\r
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r