]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg
authorStar Zeng <star.zeng@intel.com>
Thu, 26 Nov 2015 08:48:38 +0000 (08:48 +0000)
committerlzeng14 <lzeng14@Edk2>
Thu, 26 Nov 2015 08:48:38 +0000 (08:48 +0000)
It is also to add GetControl/SetControl/SetAttributes implementation
for DxeEmuSerialPortLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18967 6f19259b-4bc3-4df7-8a09-765794883524

EmulatorPkg/EmulatorPkg.dsc
EmulatorPkg/EmulatorPkg.fdf
EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.c

index 8eff20edae8d2a25526e22ec9310c4c80be24c56..27a78d55709cabcd72a4feff34418ea81b46cf62 100644 (file)
@@ -87,7 +87,6 @@
   SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
-  SerialPortExtLib|EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.inf\r
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf\r
   #\r
   # Platform\r
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-  EmbeddedPkg/SerialDxe/SerialDxe.inf {\r
+  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf {\r
    <LibraryClasses>\r
       DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
       SerialPortLib|EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf\r
index a0023893bb70e250961dccb84b68d83950990763..985a78ee2f1f5147cf1ca4e8ffde1b525731a1dd 100644 (file)
@@ -161,7 +161,7 @@ INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
 INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
 INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
 \r
-INF  EmbeddedPkg/SerialDxe/SerialDxe.inf\r
+INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf\r
 INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
 INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
index 792bd62a1c67f038d7be89e5c759046e677941c8..2bf5961bf0307851e4d010fb1f97e02ecea37050 100644 (file)
@@ -2,7 +2,7 @@
   Serial Port Lib that thunks back to Emulator services to write to StdErr.\r
   All read functions are stubed out.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2011, Apple Inc. 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
@@ -116,3 +116,92 @@ SerialPortPoll (
   return gEmuThunk->PollStdIn ();\r
 }\r
 \r
+/**\r
+  Sets the control bits on a serial device.\r
+\r
+  @param Control                Sets the bits of Control that are settable.\r
+\r
+  @retval RETURN_SUCCESS        The new control bits were set on the serial device.\r
+  @retval RETURN_UNSUPPORTED    The serial device does not support this operation.\r
+  @retval RETURN_DEVICE_ERROR   The serial device is not functioning correctly.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+SerialPortSetControl (\r
+  IN UINT32 Control\r
+  )\r
+{\r
+  return RETURN_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  Retrieve the status of the control bits on a serial device.\r
+\r
+  @param Control                A pointer to return the current control signals from the serial device.\r
+\r
+  @retval RETURN_SUCCESS        The control bits were read from the serial device.\r
+  @retval RETURN_UNSUPPORTED    The serial device does not support this operation.\r
+  @retval RETURN_DEVICE_ERROR   The serial device is not functioning correctly.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+SerialPortGetControl (\r
+  OUT UINT32 *Control\r
+  )\r
+{\r
+  *Control = 0;\r
+  if (!SerialPortPoll ()) {\r
+    *Control = EFI_SERIAL_INPUT_BUFFER_EMPTY;\r
+  }\r
+  return RETURN_SUCCESS;\r
+}\r
+\r
+/**\r
+  Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
+  data bits, and stop bits on a serial device.\r
+\r
+  @param BaudRate           The requested baud rate. A BaudRate value of 0 will use the\r
+                            device's default interface speed.\r
+                            On output, the value actually set.\r
+  @param ReveiveFifoDepth   The requested depth of the FIFO on the receive side of the\r
+                            serial interface. A ReceiveFifoDepth value of 0 will use\r
+                            the device's default FIFO depth.\r
+                            On output, the value actually set.\r
+  @param Timeout            The requested time out for a single character in microseconds.\r
+                            This timeout applies to both the transmit and receive side of the\r
+                            interface. A Timeout value of 0 will use the device's default time\r
+                            out value.\r
+                            On output, the value actually set.\r
+  @param Parity             The type of parity to use on this serial device. A Parity value of\r
+                            DefaultParity will use the device's default parity value.\r
+                            On output, the value actually set.\r
+  @param DataBits           The number of data bits to use on the serial device. A DataBits\r
+                            vaule of 0 will use the device's default data bit setting.\r
+                            On output, the value actually set.\r
+  @param StopBits           The number of stop bits to use on this serial device. A StopBits\r
+                            value of DefaultStopBits will use the device's default number of\r
+                            stop bits.\r
+                            On output, the value actually set.\r
+\r
+  @retval RETURN_SUCCESS            The new attributes were set on the serial device.\r
+  @retval RETURN_UNSUPPORTED        The serial device does not support this operation.\r
+  @retval RETURN_INVALID_PARAMETER  One or more of the attributes has an unsupported value.\r
+  @retval RETURN_DEVICE_ERROR       The serial device is not functioning correctly.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+SerialPortSetAttributes (\r
+  IN OUT UINT64             *BaudRate,\r
+  IN OUT UINT32             *ReceiveFifoDepth,\r
+  IN OUT UINT32             *Timeout,\r
+  IN OUT EFI_PARITY_TYPE    *Parity,\r
+  IN OUT UINT8              *DataBits,\r
+  IN OUT EFI_STOP_BITS_TYPE *StopBits\r
+  )\r
+{\r
+  return RETURN_UNSUPPORTED;\r
+}\r
+\r