]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Uefi/InteractiveIO/TerminalFunctions.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / LibC / Uefi / InteractiveIO / TerminalFunctions.c
diff --git a/StdLib/LibC/Uefi/InteractiveIO/TerminalFunctions.c b/StdLib/LibC/Uefi/InteractiveIO/TerminalFunctions.c
deleted file mode 100644 (file)
index 807ab1f..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/** @file\r
-    "Terminal" Control functions for Interactive IO.\r
-\r
-    Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
-    This program and the accompanying materials are licensed and made available under\r
-    the terms and conditions of the BSD License that accompanies this distribution.\r
-    The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.\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
-#include  <Uefi.h>\r
-#include  <Library/BaseMemoryLib.h>\r
-\r
-#include  <LibConfig.h>\r
-\r
-#include  <errno.h>\r
-#include  <sys/termios.h>\r
-#include  <Device/IIO.h>\r
-#include  <MainData.h>\r
-\r
-/** Get input baud rate.\r
-\r
-    Extracts the input baud rate from the termios structure pointed to by the\r
-    pTermios argument.\r
-\r
-    @param[in]  pTermios  A pointer to the termios structure from which to extract\r
-                          the input baud rate.\r
-\r
-    @return The value of the input speed is returned exactly as it is contained\r
-            in the termios structure, without interpretation.\r
-**/\r
-speed_t\r
-cfgetispeed (\r
-  const struct termios *pTermios\r
-  )\r
-{\r
-  return pTermios->c_ispeed;\r
-}\r
-\r
-/** Get output baud rate.\r
-\r
-    Extracts the output baud rate from the termios structure pointed to by the\r
-    pTermios argument.\r
-\r
-    @param[in]  pTermios  A pointer to the termios structure from which to extract\r
-                          the output baud rate.\r
-\r
-    @return The value of the output speed is returned exactly as it is contained\r
-            in the termios structure, without interpretation.\r
-**/\r
-speed_t\r
-cfgetospeed (\r
-  const struct termios *pTermios\r
-  )\r
-{\r
-  return pTermios->c_ospeed;\r
-}\r
-\r
-/** Set input baud rate.\r
-\r
-    Replaces the input baud rate, in the termios structure pointed to by the\r
-    pTermios argument, with the value of NewSpeed.\r
-\r
-    @param[out]   pTermios  A pointer to the termios structure into which to set\r
-                            the input baud rate.\r
-    @param[in]    NewSpeed  The new input baud rate.\r
-\r
-    @retval 0     The operation completed successfully.\r
-    @retval -1    An error occured and errno is set to indicate the error.\r
-                    * EINVAL - The value of NewSpeed is outside the range of\r
-                      possible speed values as specified in <sys/termios.h>.\r
-**/\r
-int\r
-cfsetispeed (\r
-  struct termios *pTermios,\r
-  speed_t         NewSpeed\r
-  )\r
-{\r
-  int RetVal;\r
-\r
-  if(NewSpeed < B921600) {\r
-    pTermios->c_ispeed = NewSpeed;\r
-    RetVal = 0;\r
-  }\r
-  else {\r
-    RetVal = -1;\r
-    errno = EINVAL;\r
-  }\r
-  return RetVal;\r
-}\r
-\r
-/** Set output baud rate.\r
-\r
-    Replaces the output baud rate, in the termios structure pointed to by the\r
-    pTermios argument, with the value of NewSpeed.\r
-\r
-    @param[out]   pTermios  A pointer to the termios structure into which to set\r
-                            the output baud rate.\r
-    @param[in]    NewSpeed  The new output baud rate.\r
-\r
-    @retval 0     The operation completed successfully.\r
-    @retval -1    An error occured and errno is set to indicate the error.\r
-                    * EINVAL - The value of NewSpeed is outside the range of\r
-                      possible speed values as specified in <sys/termios.h>.\r
-**/\r
-int\r
-cfsetospeed (\r
-  struct termios *pTermios,\r
-  speed_t         NewSpeed\r
-  )\r
-{\r
-  int RetVal;\r
-\r
-  if(NewSpeed < B921600) {\r
-    pTermios->c_ospeed = NewSpeed;\r
-    RetVal = 0;\r
-  }\r
-  else {\r
-    RetVal = -1;\r
-    errno = EINVAL;\r
-  }\r
-  return RetVal;\r
-}\r
-\r
-/** Get the parameters associated with an interactive IO device.\r
-\r
-    Get the parameters associated with the device referred to by\r
-    fd and store them into the termios structure referenced by pTermios.\r
-\r
-    @param[in]    fd        The file descriptor for an open interactive IO device.\r
-    @param[out]   pTermios  A pointer to a termios structure into which to store\r
-                            attributes of the interactive IO device.\r
-\r
-    @retval 0     The operation completed successfully.\r
-    @retval -1    An error occured and errno is set to indicate the error.\r
-                    * EBADF - The fd argument is not a valid file descriptor.\r
-                    * ENOTTY - The file associated with fd is not an interactive IO device.\r
-**/\r
-int\r
-tcgetattr (\r
-  int             fd,\r
-  struct termios *pTermios\r
-  )\r
-{\r
-  cIIO             *IIO;\r
-  int               RetVal;\r
-  struct __filedes *filp;\r
-  struct termios   *Termio;\r
-\r
-  RetVal = 0;\r
-  if(ValidateFD( fd, VALID_OPEN)) {\r
-    filp = &gMD->fdarray[fd];\r
-\r
-    if((filp->f_iflags & _S_ITTY) != 0) {\r
-      // fd is for a TTY or "Interactive IO" device\r
-      IIO = (cIIO *)filp->devdata;\r
-      Termio = &IIO->Termio;\r
-      (void)CopyMem((void *)pTermios, (const void *)Termio, sizeof(struct termios));\r
-    }\r
-    else {\r
-      errno   = ENOTTY;\r
-      RetVal  = -1;\r
-    }\r
-  }\r
-  else {\r
-    errno   = EBADF;\r
-    RetVal  = -1;\r
-  }\r
-  return RetVal;\r
-}\r
-\r
-/** Set the parameters associated with an interactive IO device.\r
-\r
-    Set the parameters associated with the device referred to by\r
-    fd to the values in the termios structure referenced by pTermios.\r
-\r
-    Behavior is modified by the value of the OptAct parameter:\r
-      * TCSANOW: The change shall occur immediately.\r
-      * TCSADRAIN: The change shall occur after all output written to fd is\r
-        transmitted. This action should be used when changing parameters which\r
-        affect output.\r
-      * TCSAFLUSH: The change shall occur after all output written to fd is\r
-        transmitted, and all input so far received but not read shall be\r
-        discarded before the change is made.\r
-\r
-    @param[in]  fd        The file descriptor for an open interactive IO device.\r
-    @param[in]  OptAct    Currently has no effect.\r
-    @param[in]  pTermios  A pointer to a termios structure into which to retrieve\r
-                          attributes to set in the interactive IO device.\r
-\r
-    @retval 0     The operation completed successfully.\r
-    @retval -1    An error occured and errno is set to indicate the error.\r
-                    * EBADF - The fd argument is not a valid file descriptor.\r
-                    * ENOTTY - The file associated with fd is not an interactive IO device.\r
-**/\r
-int\r
-tcsetattr (\r
-  int                   fd,\r
-  int                   OptAct,   // Currently ignored\r
-  const struct termios *pTermios\r
-  )\r
-{\r
-  cIIO             *IIO;\r
-  int               RetVal;\r
-  struct __filedes *filp;\r
-  struct termios   *Termio;\r
-\r
-  RetVal = 0;\r
-  if(ValidateFD( fd, VALID_OPEN)) {\r
-    filp = &gMD->fdarray[fd];\r
-\r
-    if((filp->f_iflags & _S_ITTY) != 0) {\r
-      // fd is for a TTY or "Interactive IO" device\r
-      IIO = (cIIO *)filp->devdata;\r
-      Termio = &IIO->Termio;\r
-      (void)CopyMem((void *)Termio, (const void *)pTermios, sizeof(struct termios));\r
-    }\r
-    else {\r
-      errno   = ENOTTY;\r
-      RetVal  = -1;\r
-    }\r
-  }\r
-  else {\r
-    errno   = EBADF;\r
-    RetVal  = -1;\r
-  }\r
-  return RetVal;\r
-}\r
-\r
-/** Transmit pending output.\r
-\r
-    Function is not yet implemented for UEFI.\r
-\r
-    @param[in]  fd        Ignored\r
-\r
-    @retval -1    This function is not yet supported.  errno is set to ENOTSUP.\r
-**/\r
-int\r
-tcdrain (int fd)\r
-{\r
-  errno = ENOTSUP;\r
-  return -1;\r
-}\r
-\r
-/** Suspend or restart the transmission or reception of data.\r
-\r
-    This function will suspend or resume transmission or reception of data on\r
-    the file referred to by fd, depending on the value of Action.\r
-\r
-    Function is not yet implemented for UEFI.\r
-\r
-    @param[in]  fd        Ignored\r
-    @param[in]  Action    Ignored\r
-\r
-    @retval -1    This function is not yet supported.  errno is set to ENOTSUP.\r
-**/\r
-int\r
-tcflow (\r
-  int fd,\r
-  int Action)\r
-{\r
-  errno = ENOTSUP;\r
-  return -1;\r
-}\r
-\r
-/** Discard non-transmitted output data, non-read input data, or both.\r
-\r
-    Function is not yet implemented for UEFI.\r
-\r
-    @param[in]  fd              Ignored\r
-    @param[in]  QueueSelector   Ignored\r
-\r
-    @retval -1    This function is not yet supported.  errno is set to ENOTSUP.\r
-**/\r
-int\r
-tcflush (\r
-  int fd,\r
-  int QueueSelector)\r
-{\r
-  errno = ENOTSUP;\r
-  return -1;\r
-}\r
-\r