]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Dxe/WinNtThunk/Bus/SerialIo/WinNtSerialIo.c
1. Perfect libraries MSA files
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / SerialIo / WinNtSerialIo.c
index a4a7a32b5416307875a9c2759caae2f7ca975dd8..3de4a86128f559970b478f568e8ecfa437bc9339 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 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
+Copyright (c) 2006 - 2007, 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
@@ -20,7 +20,7 @@ Abstract:
 \r
   Handle(1) - WinNtIo - DevicePath(1)\r
 \r
-  If a serial port is added to the system this driver creates a new handle. \r
+  If a serial port is added to the system this driver creates a new handle.\r
   The new handle is required, since the serial device must add an UART device\r
   pathnode.\r
 \r
@@ -32,15 +32,15 @@ Abstract:
 \r
   Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort\r
 \r
-  If the driver is unloaded Handle(2) is removed from the system and \r
+  If the driver is unloaded Handle(2) is removed from the system and\r
   gEfiWinNtSerialPortGuid is removed from Handle(1).\r
 \r
   Note: Handle(1) is any handle created by the Win NT Bus driver that is passed\r
   into the DriverBinding member functions of this driver. This driver requires\r
-  a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and \r
-  the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid. \r
-  \r
-  If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is \r
+  a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and\r
+  the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid.\r
+\r
+  If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is\r
   loaded on the device.\r
 \r
 --*/\r
@@ -135,7 +135,7 @@ Returns:
     Status = EFI_UNSUPPORTED;\r
     goto Error;\r
   }\r
-  \r
+\r
   //\r
   // Check the GUID to see if this is a handle type the driver supports\r
   //\r
@@ -309,7 +309,7 @@ Returns:
       }\r
     }\r
 \r
-    gBS->FreePool (OpenInfoBuffer);\r
+    FreePool (OpenInfoBuffer);\r
     return Status;\r
   }\r
 \r
@@ -334,12 +334,8 @@ Returns:
   //\r
   // Construct Private data\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA),\r
-                  &Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));\r
+  if (Private == NULL) {\r
     goto Error;\r
   }\r
 \r
@@ -474,12 +470,12 @@ Error:
       }\r
 \r
       if (Private->DevicePath != NULL) {\r
-        gBS->FreePool (Private->DevicePath);\r
+        FreePool (Private->DevicePath);\r
       }\r
 \r
       FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-      gBS->FreePool (Private);\r
+      FreePool (Private);\r
     }\r
   }\r
 \r
@@ -592,11 +588,11 @@ Returns:
       } else {\r
         Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
 \r
-        gBS->FreePool (Private->DevicePath);\r
+        FreePool (Private->DevicePath);\r
 \r
         FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-        gBS->FreePool (Private);\r
+        FreePool (Private);\r
       }\r
     }\r
 \r
@@ -683,7 +679,7 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.    \r
+  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.\r
   BaudRate          - The Baud rate of the serial device.\r
   ReceiveFifoDepth  - The request depth of fifo on receive side.\r
   Timeout           - the request timeout for a single charact.\r
@@ -869,7 +865,7 @@ Returns:
   }\r
 \r
   if (Private->DevicePath != NULL) {\r
-    gBS->FreePool (Private->DevicePath);\r
+    FreePool (Private->DevicePath);\r
   }\r
 \r
   Private->DevicePath = NewDevicePath;\r
@@ -1029,7 +1025,7 @@ Returns:
   if (ModemStatus & MS_RLSD_ON) {\r
     Bits |= EFI_SERIAL_CARRIER_DETECT;\r
   }\r
-  \r
+\r
   //\r
   // Get ctrl status\r
   //\r
@@ -1059,7 +1055,7 @@ Returns:
   if (Private->HardwareLoopbackEnable) {\r
     Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
   }\r
-  \r
+\r
   //\r
   //  Get input buffer status\r
   //\r
@@ -1145,7 +1141,7 @@ Returns:
         Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
         WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
       }\r
-      \r
+\r
       //\r
       //  Do the write\r
       //\r
@@ -1285,10 +1281,10 @@ IsaSerialFifoFull (
 \r
   Routine Description:\r
   Detect whether specific FIFO is full or not\r
-  \r
+\r
   Arguments:\r
   Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    \r
+\r
   Returns:\r
   TRUE:  the FIFO is full\r
   FALSE: the FIFO is not full\r
@@ -1310,10 +1306,10 @@ IsaSerialFifoEmpty (
 \r
   Routine Description:\r
   Detect whether specific FIFO is empty or not\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    \r
+\r
   Returns:\r
     TRUE:  the FIFO is empty\r
     FALSE: the FIFO is not empty\r
@@ -1336,14 +1332,14 @@ IsaSerialFifoAdd (
 \r
   Routine Description:\r
   Add data to specific FIFO\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8: the data added to FIFO  \r
-  \r
+    Data  UINT8: the data added to FIFO\r
+\r
   Returns:\r
     EFI_SUCCESS:  Add data to specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full \r
+    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full\r
 \r
 --*/\r
 // TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
@@ -1354,7 +1350,7 @@ IsaSerialFifoAdd (
   if (IsaSerialFifoFull (Fifo)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // FIFO is not full can add data\r
   //\r
@@ -1377,11 +1373,11 @@ IsaSerialFifoRemove (
 \r
   Routine Description:\r
   Remove data from specific FIFO\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8*: the data removed from FIFO  \r
-  \r
+    Data  UINT8*: the data removed from FIFO\r
+\r
   Returns:\r
     EFI_SUCCESS:  Remove data from specific FIFO successfully\r
     EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty\r
@@ -1395,7 +1391,7 @@ IsaSerialFifoRemove (
   if (IsaSerialFifoEmpty (Fifo)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // FIFO is not empty, can remove data\r
   //\r