]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove unused variable and function
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2007 08:17:24 +0000 (08:17 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2007 08:17:24 +0000 (08:17 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2606 6f19259b-4bc3-4df7-8a09-765794883524

EdkUnixPkg/Dxe/UnixThunk/Bus/SerialIo/UnixSerialIo.c
EdkUnixPkg/Include/Protocol/UnixThunk.h
EdkUnixPkg/Sec/UnixThunk.c

index 58cc68961e88d5d34837df69dc489f522721d748..e3fd034ab31c4ab4031af58388ed48a0b4f49992 100644 (file)
@@ -57,25 +57,6 @@ EFI_DRIVER_BINDING_PROTOCOL gUnixSerialIoDriverBinding = {
   NULL\r
 };\r
 \r
   NULL\r
 };\r
 \r
-STATIC\r
-VOID\r
-PrintSerialParameter(\r
-  UNIX_SERIAL_IO_PRIVATE_DATA *Private\r
-  )\r
-{\r
-  struct termios Options;\r
-\r
-  if (Private->UnixThunk->Tcgetattr (Private->UnixHandle, &Options) == 0) {\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Input mode: 0x%x\r\n", Private->UnixHandle, Options.c_iflag));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Output mode: 0x%x\r\n", Private->UnixHandle, Options.c_oflag));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Control flag: 0x%x\r\n", Private->UnixHandle, Options.c_cflag));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Local mode flag: 0x%x\r\n", Private->UnixHandle, Options.c_lflag));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Line discipline: 0x%x\r\n", Private->UnixHandle, Options.c_line));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Input Speed: 0x%x\r\n", Private->UnixHandle, Options.c_ispeed));\r
-    DEBUG ((EFI_D_INFO, "Serial[0x%x]:Output Speed: 0x%x\r\n", Private->UnixHandle, Options.c_ospeed));\r
-  }\r
-}\r
-\r
 STATIC\r
 UINTN\r
 ConvertBaud2Unix (\r
 STATIC\r
 UINTN\r
 ConvertBaud2Unix (\r
@@ -1134,7 +1115,6 @@ Returns:
   UNIX_SERIAL_IO_PRIVATE_DATA *Private;\r
   UINTN                       Result;\r
   UINTN                       Status;\r
   UNIX_SERIAL_IO_PRIVATE_DATA *Private;\r
   UINTN                       Result;\r
   UINTN                       Status;\r
-  struct termios              Options;\r
   UINT32                      Bits;\r
   EFI_TPL                     Tpl;\r
   UINTN                       Bytes;\r
   UINT32                      Bits;\r
   EFI_TPL                     Tpl;\r
   UINTN                       Bytes;\r
index 1fa4e902048660db52f8bcad0acd818d1547e32d..36043a074ca2bcf3d05450764c7c01e0145ee78b 100644 (file)
@@ -1,52 +1,52 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation                                                         \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
-Module Name:\r
-\r
-  UnixThunk.h\r
-\r
-Abstract:\r
-\r
-  This protocol allows an EFI driver in the Unix emulation environment\r
-  to make Posix calls.\r
-\r
-  NEVER make an Unix call directly, always make the call via this protocol.\r
-\r
-  There are no This pointers on the protocol member functions as they map\r
-  exactly into Unix system calls.\r
-\r
---*/\r
-\r
-#ifndef _UNIX_THUNK_H_\r
-#define _UNIX_THUNK_H_\r
-\r
-#include <sys/termios.h>\r
-
-#define EFI_UNIX_THUNK_PROTOCOL_GUID \\r
-  { \\r
+/*++
+
+Copyright (c) 2004, Intel Corporation                                                         
+All rights reserved. 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        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+  UnixThunk.h
+
+Abstract:
+
+  This protocol allows an EFI driver in the Unix emulation environment
+  to make Posix calls.
+
+  NEVER make an Unix call directly, always make the call via this protocol.
+
+  There are no This pointers on the protocol member functions as they map
+  exactly into Unix system calls.
+
+--*/
+
+#ifndef _UNIX_THUNK_H_
+#define _UNIX_THUNK_H_
+
+#include <sys/termios.h>
+
+#define EFI_UNIX_THUNK_PROTOCOL_GUID \
+  { \
     0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
     0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
-  }\r
-\r
-typedef\r
-VOID\r
-(*UnixSleep) (\r
-  unsigned long Milliseconds\r
-  );\r
-\r
-typedef\r
-VOID\r
-(*UnixExit) (\r
-  int status  // exit code for all threads\r
-  );\r
-\r
+  }
+
+typedef
+VOID
+(*UnixSleep) (
+  unsigned long Milliseconds
+  );
+
+typedef
+VOID
+(*UnixExit) (
+  int status  // exit code for all threads
+  );
+
 typedef
 VOID
 (*UnixSetTimer) (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs));
 typedef
 VOID
 (*UnixSetTimer) (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs));
@@ -138,55 +138,51 @@ typedef
 EFI_STATUS
 (*UnixUgaCreate)(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,
                 CONST CHAR16 *Title);
 EFI_STATUS
 (*UnixUgaCreate)(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,
                 CONST CHAR16 *Title);
-\r
-typedef\r
-int\r
-(*UnixTcflush) (int fildes, int queue_selector);\r
-\r
-typedef\r
-void\r
-(*UnixPerror) (__const char *__s);\r
-\r
-typedef\r
-void\r
-(*UnixPrintf) (const char* format, ...);\r
-\r
-typedef \r
-int \r
-(*UnixIoCtl) (int fd, unsigned long int __request, ...);\r
-\r
-typedef \r
-int \r
-(*UnixFcntl) (int __fd, int __cmd, ...);\r
-\r
-typedef\r
-int \r
-(*UnixCfsetispeed) (struct termios *__termios_p, speed_t __speed);\r
-\r
-typedef \r
-int \r
-(*UnixCfsetospeed) (struct termios *__termios_p, speed_t __speed);\r
-\r
-typedef\r
-int \r
-(*UnixTcgetattr) (int __fd, struct termios *__termios_p);\r
-\r
-typedef \r
-int \r
-(*UnixTcsetattr) (int __fd, int __optional_actions,\r
-                     __const struct termios *__termios_p);\r
-
-//\r
-//\r
-//\r
-\r
-#define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('L', 'N', 'X', 'T')\r
-\r
-typedef struct _EFI_UNIX_THUNK_PROTOCOL {\r
-  UINT64                              Signature;\r
-
-  UnixSleep                           Sleep;\r
-  UnixExit                           Exit;\r
+
+typedef
+int
+(*UnixTcflush) (int fildes, int queue_selector);
+
+typedef
+void
+(*UnixPerror) (__const char *__s);
+
+typedef 
+int 
+(*UnixIoCtl) (int fd, unsigned long int __request, ...);
+
+typedef 
+int 
+(*UnixFcntl) (int __fd, int __cmd, ...);
+
+typedef
+int 
+(*UnixCfsetispeed) (struct termios *__termios_p, speed_t __speed);
+
+typedef 
+int 
+(*UnixCfsetospeed) (struct termios *__termios_p, speed_t __speed);
+
+typedef
+int 
+(*UnixTcgetattr) (int __fd, struct termios *__termios_p);
+
+typedef 
+int 
+(*UnixTcsetattr) (int __fd, int __optional_actions,
+                     __const struct termios *__termios_p);
+
+//
+//
+//
+
+#define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('L', 'N', 'X', 'T')
+
+typedef struct _EFI_UNIX_THUNK_PROTOCOL {
+  UINT64                              Signature;
+
+  UnixSleep                           Sleep;
+  UnixExit                           Exit;
   UnixSetTimer                        SetTimer;
   UnixGetLocalTime                             GetLocalTime;
   UnixGmTime                          GmTime;
   UnixSetTimer                        SetTimer;
   UnixGetLocalTime                             GetLocalTime;
   UnixGmTime                          GmTime;
@@ -217,16 +213,15 @@ typedef struct _EFI_UNIX_THUNK_PROTOCOL {
   UnixUTime                           UTime;
   UnixTcflush                         Tcflush;
   UnixUgaCreate                                          UgaCreate;
   UnixUTime                           UTime;
   UnixTcflush                         Tcflush;
   UnixUgaCreate                                          UgaCreate;
-  UnixPerror                          Perror;\r
-  UnixPrintf                          Printf;\r
-  UnixIoCtl                           IoCtl;\r
-  UnixFcntl                           Fcntl;\r
-  UnixCfsetispeed                     Cfsetispeed;\r
-  UnixCfsetospeed                     Cfsetospeed;\r
-  UnixTcgetattr                       Tcgetattr;\r
-  UnixTcsetattr                       Tcsetattr;\r
+  UnixPerror                          Perror;
+  UnixIoCtl                           IoCtl;
+  UnixFcntl                           Fcntl;
+  UnixCfsetispeed                     Cfsetispeed;
+  UnixCfsetospeed                     Cfsetospeed;
+  UnixTcgetattr                       Tcgetattr;
+  UnixTcsetattr                       Tcsetattr;
 } EFI_UNIX_THUNK_PROTOCOL;
 } EFI_UNIX_THUNK_PROTOCOL;
-\r
-extern EFI_GUID gEfiUnixThunkProtocolGuid;\r
-\r
-#endif\r
+
+extern EFI_GUID gEfiUnixThunkProtocolGuid;
+
+#endif
index 9d74b5b8c30b10ac811398d7dd686c5810bb5a20..fcf290ddbb218d7d10d03ef1ec31d93b2cbefadc 100644 (file)
@@ -1,43 +1,43 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2006, Intel Corporation                                                         \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
-Module Name:\r
-\r
-  UnixThunk.c\r
-\r
-Abstract:\r
-\r
-  Since the SEC is the only program in our emulation we \r
-  must use a Tiano mechanism to export APIs to other modules.\r
-  This is the role of the EFI_UNIX_THUNK_PROTOCOL.\r
-\r
-  The mUnixThunkTable exists so that a change to EFI_UNIX_THUNK_PROTOCOL\r
-  will cause an error in initializing the array if all the member functions\r
-  are not added. It looks like adding a element to end and not initializing\r
-  it may cause the table to be initaliized with the members at the end being\r
-  set to zero. This is bad as jumping to zero will crash.\r
-  \r
-\r
-  gUnix is a a public exported global that contains the initialized\r
-  data.\r
-\r
---*/\r
-\r
-#include "SecMain.h"\r
+/*++
+
+Copyright (c) 2004 - 2006, Intel Corporation                                                         
+All rights reserved. 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        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+  UnixThunk.c
+
+Abstract:
+
+  Since the SEC is the only program in our emulation we 
+  must use a Tiano mechanism to export APIs to other modules.
+  This is the role of the EFI_UNIX_THUNK_PROTOCOL.
+
+  The mUnixThunkTable exists so that a change to EFI_UNIX_THUNK_PROTOCOL
+  will cause an error in initializing the array if all the member functions
+  are not added. It looks like adding a element to end and not initializing
+  it may cause the table to be initaliized with the members at the end being
+  set to zero. This is bad as jumping to zero will crash.
+  
+
+  gUnix is a a public exported global that contains the initialized
+  data.
+
+--*/
+
+#include "SecMain.h"
 #include "Library/UnixLib.h"
 #include <sys/time.h>
 #include <time.h>
 #include <signal.h>
 #include <string.h>
 #include "Library/UnixLib.h"
 #include <sys/time.h>
 #include <time.h>
 #include <signal.h>
 #include <string.h>
-#include <stdlib.h>\r
+#include <stdlib.h>
 #include <termio.h>
 
 static int settimer_initialized;
 #include <termio.h>
 
 static int settimer_initialized;
@@ -156,8 +156,8 @@ GetErrno(void)
 extern EFI_STATUS
 UgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title);
 
 extern EFI_STATUS
 UgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title);
 
-EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {\r
-  EFI_UNIX_THUNK_PROTOCOL_SIGNATURE,\r
+EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
+  EFI_UNIX_THUNK_PROTOCOL_SIGNATURE,
   msSleep, /* Sleep */
   exit, /* Exit */
   SetTimer,
   msSleep, /* Sleep */
   exit, /* Exit */
   SetTimer,
@@ -189,16 +189,15 @@ EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
   chmod,
   utime,
   tcflush,
   chmod,
   utime,
   tcflush,
-  UgaCreate,\r
-  perror,\r
-  printf,\r
-  ioctl,\r
-  fcntl,\r
-  cfsetispeed,\r
-  cfsetospeed,\r
-  tcgetattr,\r
+  UgaCreate,
+  perror,
+  ioctl,
+  fcntl,
+  cfsetispeed,
+  cfsetospeed,
+  tcgetattr,
   tcsetattr
   tcsetattr
-};\r
-\r
-\r
-EFI_UNIX_THUNK_PROTOCOL *gUnix = &mUnixThunkTable;\r
+};
+
+
+EFI_UNIX_THUNK_PROTOCOL *gUnix = &mUnixThunkTable;