]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c
Adding support for BeagleBoard.
[mirror_edk2.git] / EmbeddedPkg / Library / TemplateSerialPortLib / TemplateSerialPortLib.c
diff --git a/EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c b/EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c
new file mode 100644 (file)
index 0000000..98087f9
--- /dev/null
@@ -0,0 +1,99 @@
+/** @file\r
+  Serial I/O Port library functions with no library constructor/destructor\r
+\r
+  Copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
+  \r
+  All rights reserved. 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
+\r
+\r
+#include <Library/SerialPortLib.h>\r
+\r
+/*\r
+\r
+  Programmed hardware of Serial port.\r
+\r
+  @return    Always return EFI_UNSUPPORTED.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+SerialPortInitialize (\r
+  VOID\r
+  )\r
+{\r
+  return RETURN_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  Write data to serial device.\r
+\r
+  @param  Buffer           Point of data buffer which need to be writed.\r
+  @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
+\r
+  @retval 0                Write data failed.\r
+  @retval !0               Actual number of bytes writed to serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortWrite (\r
+  IN UINT8     *Buffer,\r
+  IN UINTN     NumberOfBytes\r
+)\r
+{\r
+  return 0;\r
+}\r
+\r
+\r
+/**\r
+  Read data from serial device and save the datas in buffer.\r
+\r
+  @param  Buffer           Point of data buffer which need to be writed.\r
+  @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
+\r
+  @retval 0                Read data failed.\r
+  @retval !0               Aactual number of bytes read from serial device.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SerialPortRead (\r
+  OUT UINT8     *Buffer,\r
+  IN  UINTN     NumberOfBytes\r
+)\r
+{\r
+  return 0;\r
+}\r
+\r
+\r
+\r
+/**\r
+  Poll the serial device to see if there is any data waiting.\r
+\r
+  If there is data waiting to be read from the serial port, then return\r
+  TRUE.  If there is no data waiting to be read from the serial port, then \r
+  return FALSE.\r
+\r
+  @retval TRUE             Data is waiting to be read.\r
+  @retval FALSE            There is no data waiting to be read.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+SerialPortPoll (\r
+  VOID\r
+  )\r
+{\r
+  return 0;\r
+}\r
+\r