Fix compilation errors detected with GCC 4.4

Signed-off-by: lpleahy


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/EADK@12503 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c
index 2d34126..9f885e9 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -204,7 +204,7 @@
     break;

 

   case IP_HDRINCL:

-    *ppOptionData = (void *)pSocket->bIncludeHeader;

+    *ppOptionData = (void *)&pSocket->bIncludeHeader;

     *pOptionLength = sizeof ( pSocket->bIncludeHeader );

     break;

   }

diff --git a/StdLib/EfiSocketLib/ReleaseNotes.txt b/StdLib/EfiSocketLib/ReleaseNotes.txt
index fd8ed74..c978e42 100644
--- a/StdLib/EfiSocketLib/ReleaseNotes.txt
+++ b/StdLib/EfiSocketLib/ReleaseNotes.txt
@@ -23,6 +23,9 @@
 

 *  TCPv4 transfer rate is slow (< 10 Mbits/sec) - This is an unidentified issue.

 

+*  Tcp4Dxe transmits more urgent data than is sent through sockets when normal data is

+   queued for transmission before the urgent data.  HSD 206365

+

 *  Raw socket applications are not able to pass the IP header as part of their

    payload by using the IP option IP_HDRINCL.  This is because the UEFI IPv4 driver

    (Ip4Dxe) does not support RawData. HSD 206136

diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index 42e4689..9c2d2f6 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -2307,7 +2307,7 @@
   IN ESL_IO_MGMT ** ppFreeQueue,

   IN UINTN DebugFlags,

   IN CHAR8 * pEventName,

-  IN EFI_EVENT_NOTIFY pfnCompletion

+  IN PFN_API_IO_COMPLETE pfnCompletion

   )

 {

   ESL_IO_MGMT * pEnd;

@@ -2670,7 +2670,7 @@
   int errno;

   socklen_t LengthInBytes;

   socklen_t MaxBytes;

-  UINT8 * pOptionData;

+  CONST UINT8 * pOptionData;

   ESL_SOCKET * pSocket;

   EFI_STATUS Status;

 

@@ -2709,7 +2709,7 @@
         if ( pSocket->pApi->DefaultProtocol == level ) {

           Status = pSocket->pApi->pfnOptionGet ( pSocket,

                                                  OptionName,

-                                                 &pOptionData,

+                                                 (CONST void ** __restrict)&pOptionData,

                                                  &LengthInBytes );

           errno = pSocket->errno;

           break;

@@ -2749,7 +2749,7 @@
         //

         //  Return the listen flag

         //

-        pOptionData = (UINT8 *)&pSocket->bListenCalled;

+        pOptionData = (CONST UINT8 *)&pSocket->bListenCalled;

         LengthInBytes = sizeof ( pSocket->bListenCalled );

         break;

 

@@ -2757,7 +2757,7 @@
         //

         //  Return the debug flags

         //

-        pOptionData = (UINT8 *)&pSocket->bOobInLine;

+        pOptionData = (CONST UINT8 *)&pSocket->bOobInLine;

         LengthInBytes = sizeof ( pSocket->bOobInLine );

         break;

 

@@ -2765,7 +2765,7 @@
         //

         //  Return the out-of-band inline flag

         //

-        pOptionData = (UINT8 *)&pSocket->bOobInLine;

+        pOptionData = (CONST UINT8 *)&pSocket->bOobInLine;

         LengthInBytes = sizeof ( pSocket->bOobInLine );

         break;

 

@@ -2773,7 +2773,7 @@
         //

         //  Return the receive timeout

         //

-        pOptionData = (UINT8 *)&pSocket->RxTimeout;

+        pOptionData = (CONST UINT8 *)&pSocket->RxTimeout;

         LengthInBytes = sizeof ( pSocket->RxTimeout );

         break;

         

@@ -2781,7 +2781,7 @@
         //

         //  Return the maximum receive buffer size

         //

-        pOptionData = (UINT8 *)&pSocket->MaxRxBuf;

+        pOptionData = (CONST UINT8 *)&pSocket->MaxRxBuf;

         LengthInBytes = sizeof ( pSocket->MaxRxBuf );

         break;

 

@@ -2789,7 +2789,7 @@
         //

         //  Return the maximum transmit buffer size

         //

-        pOptionData = (UINT8 *)&pSocket->MaxTxBuf;

+        pOptionData = (CONST UINT8 *)&pSocket->MaxTxBuf;

         LengthInBytes = sizeof ( pSocket->MaxTxBuf );

         break;

 

@@ -2797,7 +2797,7 @@
         //

         //  Return the socket type

         //

-        pOptionData = (UINT8 *)&pSocket->Type;

+        pOptionData = (CONST UINT8 *)&pSocket->Type;

         LengthInBytes = sizeof ( pSocket->Type );

         break;

       }

diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h
index 25133e6..50bb2d3 100644
--- a/StdLib/EfiSocketLib/Socket.h
+++ b/StdLib/EfiSocketLib/Socket.h
@@ -220,7 +220,7 @@
     EFI_UDP4_COMPLETION_TOKEN Udp4Rx; ///<  UDP4 receive token

     EFI_UDP4_COMPLETION_TOKEN Udp4Tx; ///<  UDP4 transmit token

   } Token;                            ///<  Completion token for the network operation

-};

+} GCC_IO_MGMT;

 

 /**

   IP4 context structure

@@ -481,6 +481,26 @@
   );

 

 /**

+  Process the completion event

+

+  This routine handles the I/O completion event.

+

+  This routine is called by the low level network driver when

+  the operation is completed.

+

+  @param [in] Event     The receive completion event

+

+  @param [in] pIo       The address of an ::ESL_IO_MGMT structure

+

+**/

+typedef

+VOID

+(* PFN_API_IO_COMPLETE) (

+  IN EFI_EVENT Event,

+  IN ESL_IO_MGMT * pIo

+  );

+

+/**

   Determine if the socket is configured.

 

 

@@ -727,26 +747,6 @@
   );

 

 /**

-  Process the receive completion

-

-  This routine handles the receive completion event.

-

-  This routine is called by the low level network driver when

-  data is received.

-

-  @param [in] Event     The receive completion event

-

-  @param [in] pIo       The address of an ::ESL_IO_MGMT structure

-

-**/

-typedef

-VOID

-(* PFN_API_RX_COMPLETE) (

-  IN EFI_EVENT Event,

-  IN ESL_IO_MGMT * pIo

-  );

-

-/**

   Start a receive operation

 

   This routine prepares a packet for the receive operation.

@@ -853,7 +853,7 @@
   PFN_API_RECEIVE pfnReceive;               ///<  Attempt to receive some data

   PFN_API_REMOTE_ADDR_GET pfnRemoteAddrGet; ///<  Get remote address

   PFN_API_REMOTE_ADDR_SET pfnRemoteAddrSet; ///<  Set the remote system address

-  PFN_API_RX_COMPLETE pfnRxComplete;        ///<  RX completion

+  PFN_API_IO_COMPLETE pfnRxComplete;        ///<  RX completion

   PFN_API_RX_START pfnRxStart;              ///<  Start a network specific receive operation

   PFN_API_TRANSMIT pfnTransmit;             ///<  Attempt to buffer a packet for transmit

   PFN_API_TX_COMPLETE pfnTxComplete;        ///<  TX completion for normal data

@@ -1132,7 +1132,7 @@
   IN ESL_IO_MGMT ** ppFreeQueue,

   IN UINTN DebugFlags,

   IN CHAR8 * pEventName,

-  IN EFI_EVENT_NOTIFY pfnCompletion

+  IN PFN_API_IO_COMPLETE pfnCompletion

   );

 

 /**