Update the sockets applications

* Builds with GCC 4.4 compiler.

Signed-off by: lpleahy


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12498 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lpleahy
2011-09-30 23:04:13 +00:00
parent a88c31639b
commit 59bc059327
52 changed files with 3062 additions and 235 deletions

View File

@@ -106,19 +106,19 @@ typedef struct {
UINT16 IapcBootArch; // 109
UINT8 Reserved2; // 111
UINT32 Flags; // 112
UINT32 ResetReg [3]; // 116
UINT32 ResetReg[3]; // 116
UINT8 ResetValue; // 128
UINT8 Reserved3 [3]; // 129
UINT8 Reserved3[3]; // 129
UINT64 XFirmwareCtrl; // 132
UINT64 XDsdt; // 140
UINT32 XPm1aEvtBlk [3]; // 148
UINT32 XPm1bEvtBlk [3]; // 160
UINT32 XPm1aCntBlk [3]; // 172
UINT32 XPm1bCntBlk [3]; // 184
UINT32 XPm2CntBlk [3]; // 196
UINT32 XPmTmrBlk [3]; // 208
UINT32 XGpe0Blk [3]; // 220
UINT32 XGpe1Blk [3]; // 232
UINT32 XPm1aEvtBlk[3]; // 148
UINT32 XPm1bEvtBlk[3]; // 160
UINT32 XPm1aCntBlk[3]; // 172
UINT32 XPm1bCntBlk[3]; // 184
UINT32 XPm2CntBlk[3]; // 196
UINT32 XPmTmrBlk[3]; // 208
UINT32 XGpe0Blk[3]; // 220
UINT32 XGpe1Blk[3]; // 232
} ACPI_FADT;
@@ -146,7 +146,7 @@ typedef struct {
} TABLE_SIGNATURE;
CONST TABLE_SIGNATURE mTableId [] = {
CONST TABLE_SIGNATURE mTableId[] = {
{ DSDT_SIGNATURE, "DSDT", PAGE_ACPI_DSDT },
{ FADT_SIGNATURE, "FADT", PAGE_ACPI_FADT }
};
@@ -240,8 +240,8 @@ LocateTable (
//
// Walk the list of entries
//
pEntry = &pRsdt->Entry [ 0 ];
pEnd = &pEntry [(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
pEntry = &pRsdt->Entry[ 0 ];
pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
while ( pEnd > pEntry ) {
//
// The entry is actually a 32-bit physical table address
@@ -324,7 +324,7 @@ RowAnsiArray (
// Display the characters
//
pData = pChar;
pEnd = &pChar [ Length ];
pEnd = &pChar[ Length ];
while ( pEnd > pData ) {
Status = HttpSendCharacter ( SocketFD,
pPort,
@@ -440,7 +440,7 @@ RowBytes (
if ( EFI_ERROR ( Status )) {
break;
}
pEnd = &pData [ ByteCount ];
pEnd = &pData[ ByteCount ];
while ( pEnd > pData ) {
Status = HttpSendHexBits ( SocketFD,
pPort,
@@ -784,8 +784,8 @@ SignatureLookup (
// Walk the list of tables
//
Signature = *pSignature;
pTableId = &mTableId [ 0 ];
pEnd = &pTableId [ sizeof ( mTableId ) / sizeof ( mTableId [ 0 ])];
pTableId = &mTableId[ 0 ];
pEnd = &pTableId[ sizeof ( mTableId ) / sizeof ( mTableId[ 0 ])];
while ( pEnd > pTableId ) {
//
// Attempt to locate the table signature
@@ -895,7 +895,7 @@ AcpiDsdtPage (
pPort,
"OEMID",
sizeof ( pDsdt->OemId ),
&pDsdt->OemId [ 0 ]);
&pDsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -903,7 +903,7 @@ AcpiDsdtPage (
pPort,
"OEM Table ID",
sizeof ( pDsdt->OemTableId ),
&pDsdt->OemTableId [ 0 ]);
&pDsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1039,7 +1039,7 @@ AcpiFadtPage (
pPort,
"OEMID",
sizeof ( pFadt->OemId ),
&pFadt->OemId [ 0 ]);
&pFadt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1047,7 +1047,7 @@ AcpiFadtPage (
pPort,
"OEM Table ID",
sizeof ( pFadt->OemTableId ),
&pFadt->OemTableId [ 0 ]);
&pFadt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1576,7 +1576,7 @@ AcpiRsdp10Page (
pPort,
"OemId",
sizeof ( pRsdp10b->OemId ),
&pRsdp10b->OemId [ 0 ]);
&pRsdp10b->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1679,7 +1679,7 @@ AcpiRsdp30Page (
pPort,
"OemId",
sizeof ( pRsdp30->OemId ),
&pRsdp30->OemId [ 0 ]);
&pRsdp30->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1726,7 +1726,7 @@ AcpiRsdp30Page (
pPort,
"Reserved",
sizeof ( pRsdp30->Reserved ),
&pRsdp30->Reserved [ 0 ]);
&pRsdp30->Reserved[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1771,7 +1771,7 @@ AcpiRsdtPage (
CONST CHAR8 * pTableName;
CONST CHAR16 * pWebPage;
EFI_STATUS Status;
UINT32 TableName [ 2 ];
UINT32 TableName[ 2 ];
DBG_ENTER ( );
@@ -1833,7 +1833,7 @@ AcpiRsdtPage (
pPort,
"OEMID",
sizeof ( pRsdt->OemId ),
&pRsdt->OemId [ 0 ]);
&pRsdt->OemId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1841,7 +1841,7 @@ AcpiRsdtPage (
pPort,
"OEM Table ID",
sizeof ( pRsdt->OemTableId ),
&pRsdt->OemTableId [ 0 ]);
&pRsdt->OemTableId[ 0 ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1871,16 +1871,16 @@ AcpiRsdtPage (
//
// Walk the list of entries
//
pEntry = &pRsdt->Entry [ 0 ];
pEnd = &pEntry [(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
TableName [ 1 ] = 0;
pEntry = &pRsdt->Entry[ 0 ];
pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];
TableName[ 1 ] = 0;
while ( pEnd > pEntry ) {
//
// The entry is actually a 32-bit physical table address
// The first entry in the table is the 32-bit table signature
//
TableName [ 0 ] = *(UINT32 *)*pEntry;
pWebPage = SignatureLookup ( &TableName [ 0 ], &pTableName );
TableName[ 0 ] = *(UINT32 *)*pEntry;
pWebPage = SignatureLookup ( &TableName[ 0 ], &pTableName );
//
// Display the table address

View File

@@ -38,7 +38,7 @@ typedef struct {
CHAR16 * pWebPage;
} GUID_NAME;
CONST GUID_NAME mGuidName [] = {
CONST GUID_NAME mGuidName[] = {
{ L"gEfiAcpi10TableGuid", &gEfiAcpi10TableGuid, PAGE_ACPI_RSDP_10B },
{ L"gEfiAcpiTableGuid", &gEfiAcpiTableGuid, PAGE_ACPI_RSDP_30 },
{ L"gEfiDebugImageInfoTableGuid", &gEfiDebugImageInfoTableGuid, NULL },
@@ -101,7 +101,7 @@ RowGuid (
// Determine if this is a known GUID
//
pGuidName = &mGuidName[0];
pGuidNameEnd = &pGuidName [ sizeof ( mGuidName ) / sizeof ( mGuidName[0])];
pGuidNameEnd = &pGuidName[ sizeof ( mGuidName ) / sizeof ( mGuidName[0])];
while ( pGuidNameEnd > pGuidName ) {
if ( CompareGuid ( pGuidName->pGuid, pGuid )) {
//
@@ -339,7 +339,7 @@ ConfigurationTablePage (
// Determine the location of the configuration tables
//
pTable = gST->ConfigurationTable;
pEnd = &pTable [ gST->NumberOfTableEntries ];
pEnd = &pTable[ gST->NumberOfTableEntries ];
while ( pEnd > pTable ) {
Status = RowGuid ( SocketFD,
pPort,

View File

@@ -561,7 +561,7 @@ HttpRequest (
// Attempt to parse the command
//
pData = &pPort->Request[0];
pEnd = &pData [ pPort->RequestLength ];
pEnd = &pData[ pPort->RequestLength ];
pVerb = pData;
pWebPage = HttpReplaceSpace ( pVerb, pEnd );
if ( pEnd <= pWebPage ) {
@@ -589,7 +589,7 @@ HttpRequest (
// Walk the page table
//
pPage = &mPageList[0];
pPageEnd = &pPage [ mPageCount ];
pPageEnd = &pPage[ mPageCount ];
while ( pPageEnd > pPage ) {
//
// Determine if the page was located
@@ -668,15 +668,14 @@ HttpSend (
//
MaxBytes = sizeof ( pPort->TxBuffer );
DataBytes = MaxBytes - pPort->TxBytes;
if ( DataBytes > LengthInBytes )
{
if ( DataBytes > LengthInBytes ) {
DataBytes = LengthInBytes;
}
//
// Copy the data into the buffer
//
CopyMem ( &pPort->TxBuffer [ pPort->TxBytes ],
CopyMem ( &pPort->TxBuffer[ pPort->TxBytes ],
pBuffer,
DataBytes );
@@ -910,7 +909,7 @@ HttpSendDump (
//
// Walk the bytes to be displayed
//
pEnd = &pData [ ByteCount ];
pEnd = &pData[ ByteCount ];
while ( pEnd > pData ) {
//
// Display the address
@@ -958,7 +957,7 @@ HttpSendDump (
if (( BYTES_ON_A_LINE - InitialSpaces ) < BytesToDisplay ) {
BytesToDisplay = BYTES_ON_A_LINE - InitialSpaces;
}
pDataEnd = &pData [ BytesToDisplay ];
pDataEnd = &pData[ BytesToDisplay ];
pTemp = pData;
while ( pDataEnd > pTemp ) {
Status = HttpSendHexBits ( SocketFD,
@@ -1151,7 +1150,7 @@ HttpSendGuid (
Status = HttpSendHexBits ( SocketFD,
pPort,
8,
pGuid->Data4 [ Index ]);
pGuid->Data4[ Index ]);
if ( EFI_ERROR ( Status )) {
break;
}
@@ -1488,7 +1487,7 @@ HttpSendValue (
UINT64 Digit;
CONST UINT64 * pEnd;
CONST UINT64 * pDivisor;
CONST UINT64 pDivisors [ ] = {
CONST UINT64 pDivisors[ ] = {
10000000000000000000L,
1000000000000000000L,
100000000000000000L,
@@ -1522,7 +1521,7 @@ HttpSendValue (
//
bDisplayZeros = FALSE;
pDivisor = &pDivisors[0];
pEnd = &pDivisor [ sizeof ( pDivisors ) / sizeof ( pDivisors [0])];
pEnd = &pDivisor[ sizeof ( pDivisors ) / sizeof ( pDivisors[0])];
while ( pEnd > pDivisor ) {
//
// Determine the next digit

View File

@@ -29,7 +29,7 @@ Intel Corporation.
/**
List of pages in the system
**/
CONST DT_PAGE mPageList [] = {
CONST DT_PAGE mPageList[] = {
//
// The index page must be first

View File

@@ -124,9 +124,9 @@ PortAdd (
// Initialize the new entries in the FD list
//
for ( ; MaxEntriesNew > Index; Index++ ) {
pFdListNew [ Index ].fd = -1;
pFdListNew [ Index ].events = 0;
pFdListNew [ Index ].revents = 0;
pFdListNew[ Index ].fd = -1;
pFdListNew[ Index ].events = 0;
pFdListNew[ Index ].revents = 0;
}
//
@@ -156,7 +156,7 @@ PortAdd (
// Initialize the new entries in the port list
//
for ( ; MaxEntriesNew > Index; Index++ ) {
ppPortListNew [ Index ] = NULL;
ppPortListNew[ Index ] = NULL;
}
//
@@ -200,15 +200,15 @@ PortAdd (
//
// Add the socket to the FD list
//
pFdList [ pWebServer->Entries ].fd = SocketFD;
pFdList [ pWebServer->Entries ].events = POLLRDNORM
pFdList[ pWebServer->Entries ].fd = SocketFD;
pFdList[ pWebServer->Entries ].events = POLLRDNORM
| POLLHUP;
pFdList [ pWebServer->Entries ].revents = 0;
pFdList[ pWebServer->Entries ].revents = 0;
//
// Add the port to the port list
//
pWebServer->ppPortList [ pWebServer->Entries ] = pPort;
pWebServer->ppPortList[ pWebServer->Entries ] = pPort;
//
// Account for the new entry
@@ -263,7 +263,7 @@ PortRemove (
//
// Locate the specified socket file descriptor
//
if ( SocketFD == pFdList [ Index ].fd ) {
if ( SocketFD == pFdList[ Index ].fd ) {
//
// Determine if this is the listen port
//
@@ -279,7 +279,7 @@ PortRemove (
//
// Free the port structure
//
gBS->FreePool ( ppPortList [ Index ]);
gBS->FreePool ( ppPortList[ Index ]);
//
// Remove this port from the list by copying
@@ -287,13 +287,13 @@ PortRemove (
//
Entries -= 1;
for ( ; Entries > Index; Index++ ) {
pFdList [ Index ] = pFdList [ Index + 1 ];
ppPortList [ Index ] = ppPortList [ Index + 1 ];
pFdList[ Index ] = pFdList[ Index + 1 ];
ppPortList[ Index ] = ppPortList[ Index + 1 ];
}
pFdList [ Index ].fd = -1;
pFdList [ Index ].events = 0;
pFdList [ Index ].revents = 0;
ppPortList [ Index ] = NULL;
pFdList[ Index ].fd = -1;
pFdList[ Index ].events = 0;
pFdList[ Index ].revents = 0;
ppPortList[ Index ] = NULL;
//
// Update the number of entries in the list
@@ -439,8 +439,7 @@ PortWork (
}
}
}
else
{
else {
//
// Receive the file data
//
@@ -610,8 +609,7 @@ WebServerTimer (
pWebServer->HttpListenPort = socket ( AF_INET,
SOCK_STREAM,
IPPROTO_TCP );
if ( -1 != pWebServer->HttpListenPort )
{
if ( -1 != pWebServer->HttpListenPort ) {
//
// Set the socket address
//

View File

@@ -125,7 +125,7 @@
#endif // MDEPKG_NDEBUG
#define WEB_SERVER_SIGNATURE SIGNATURE_32('W','e','b','S') ///< DT_WEB_SERVER memory signature
#define WEB_SERVER_SIGNATURE SIGNATURE_32 ('W','e','b','S') ///< DT_WEB_SERVER memory signature
#define SPACES_ADDRESS_TO_DATA 2
#define BYTES_ON_A_LINE 16
@@ -154,9 +154,9 @@ typedef struct {
//
size_t RequestLength; ///< Request length in bytes
size_t TxBytes; ///< Bytes in the TX buffer
UINT8 Request [ 65536 ]; ///< Page request
UINT8 RxBuffer [ 65536 ]; ///< Receive buffer
UINT8 TxBuffer [ 65536 ]; ///< Transmit buffer
UINT8 Request[ 65536 ]; ///< Page request
UINT8 RxBuffer[ 65536 ]; ///< Receive buffer
UINT8 TxBuffer[ 65536 ]; ///< Transmit buffer
} WSDT_PORT;
/**
@@ -186,7 +186,7 @@ typedef struct {
WSDT_PORT ** ppPortList; ///< List of port management structures
} DT_WEB_SERVER;
//#define SERVER_FROM_SERVICE(a) CR(a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
//#define SERVER_FROM_SERVICE(a) CR (a, DT_WEB_SERVER, ServiceBinding, WEB_SERVER_SIGNATURE) ///< Locate DT_LAYER from service binding
extern DT_WEB_SERVER mWebServer;
@@ -217,7 +217,7 @@ typedef struct {
UINT16 * pDescription; ///< Description of the page
} DT_PAGE;
extern CONST DT_PAGE mPageList []; ///< List of pages
extern CONST DT_PAGE mPageList[]; ///< List of pages
extern CONST UINTN mPageCount; ///< Number of pages
//------------------------------------------------------------------------------