]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Source fixes and cleanup for ARMGCC compiles
authorRandy Pawell <randy_pawell@hp.com>
Thu, 4 Dec 2014 00:55:50 +0000 (00:55 +0000)
committersfu5 <sfu5@Edk2>
Thu, 4 Dec 2014 00:55:50 +0000 (00:55 +0000)
- Fix EFI_IPv4_ADDRESS usages to use a macro to copy the structure
   instead of direct assignment, to avoid runtime alignment errors.
- Delete excess local variables that are initialized but otherwise unused.
- Add LibraryClasses.ARM & AARCH64 section in NetworkPkg.dsc file,
   containing a CompilerIntrinsicsLib null-library, required for successful
  standalone package builds (copied from MdeModulePkg.dsc).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Randy Pawell <randy_pawell@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16472 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
NetworkPkg/Ip6Dxe/Ip6Impl.c
NetworkPkg/NetworkPkg.dsc
NetworkPkg/TcpDxe/TcpDispatcher.c
NetworkPkg/TcpDxe/TcpMain.c
NetworkPkg/TcpDxe/TcpMisc.c
NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c

index e0a2b4b15f298625993852c6d4e758e3691d80df..b23147952517aae8d3447ce17c46551402865ea7 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Dhcp6 internal functions implementation.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -544,7 +545,6 @@ Dhcp6UpdateIaInfo (
   )\r
 {\r
   EFI_STATUS                  Status;\r
-  EFI_DHCP6_STATE             State;\r
   UINT8                       *Option;\r
   UINT8                       *IaInnerOpt;\r
   UINT16                      IaInnerLen;\r
@@ -565,7 +565,6 @@ Dhcp6UpdateIaInfo (
   //\r
   // See details in the section-18.1.8 of rfc-3315.\r
   //\r
-  State  = Dhcp6Init;\r
   Option = Dhcp6SeekIaOption (\r
              Packet->Dhcp6.Option,\r
              Packet->Length - sizeof (EFI_DHCP6_HEADER),\r
@@ -2428,14 +2427,12 @@ Dhcp6HandleAdvertiseMsg (
 {\r
   EFI_STATUS                  Status;\r
   UINT8                       *Option;\r
-  UINT16                      StsCode;\r
   BOOLEAN                     Timeout;\r
 \r
   ASSERT(Instance->Config);\r
   ASSERT(Instance->IaCb.Ia);\r
 \r
   Timeout = FALSE;\r
-  StsCode = Dhcp6StsSuccess;\r
 \r
   //\r
   // If the client does receives a valid reply message that includes a rapid\r
index 621879b1ea579583af79b1340fb0a7b101a89e13..b186c0af20ed30819fe98094a785c4d28a3bd989 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Implementation of EFI_IP6_PROTOCOL protocol interfaces.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -1761,7 +1762,6 @@ EfiIp6Cancel (
   )\r
 {\r
   IP6_PROTOCOL              *IpInstance;\r
-  IP6_SERVICE               *IpSb;\r
   EFI_STATUS                Status;\r
   EFI_TPL                   OldTpl;\r
 \r
@@ -1770,7 +1770,6 @@ EfiIp6Cancel (
   }\r
 \r
   IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);\r
-  IpSb       = IpInstance->Service;\r
 \r
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
index 491abd2b8c68f4dc241fbc52494a7724b563642e..80685dd6459d546159d1853cad5f26c3a702fc30 100644 (file)
@@ -1,6 +1,7 @@
 ## @file\r
 # UEFI 2.4 Network Module Package for All Architectures\r
 #\r
+# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #    This program and the accompanying materials\r
@@ -19,7 +20,7 @@
   PLATFORM_VERSION               = 0.95\r
   DSC_SPECIFICATION              = 0x00010005\r
   OUTPUT_DIRECTORY               = Build/NetworkPkg\r
-  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64|EBC|ARM\r
+  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64|EBC|ARM|AARCH64\r
   BUILD_TARGETS                  = DEBUG|RELEASE\r
   SKUID_IDENTIFIER               = DEFAULT\r
 \r
   SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf\r
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf\r
 \r
+[LibraryClasses.ARM, LibraryClasses.AARCH64]\r
+  #\r
+  # It is not possible to prevent ARM compiler calls to generic intrinsic functions.\r
+  # This library provides the instrinsic functions generated by a given compiler.\r
+  # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.\r
+  #\r
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf\r
+\r
 [PcdsFeatureFlag]\r
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
index 7b3d14dace1035e1fc155a7d13c67627102ca92a..d4bc8ace5597604a0b6e0279efdaa64289690307 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   The implementation of a dispatch routine for processing TCP requests.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -98,12 +99,12 @@ Tcp4GetMode (
 \r
     AccessPoint->UseDefaultAddress   = Tcb->UseDefaultAddr;\r
 \r
-    CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip);\r
 \r
-    AccessPoint->SubnetMask          = Tcb->SubnetMask;\r
+    IP4_COPY_ADDRESS (&AccessPoint->SubnetMask, &Tcb->SubnetMask);\r
     AccessPoint->StationPort         = NTOHS (Tcb->LocalEnd.Port);\r
 \r
-    CopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip);\r
 \r
     AccessPoint->RemotePort          = NTOHS (Tcb->RemoteEnd.Port);\r
     AccessPoint->ActiveFlag          = (BOOLEAN) (Tcb->State != TCP_LISTEN);\r
@@ -239,7 +240,7 @@ TcpBind (
   UINT16          *RandomPort;\r
 \r
   if (IpVersion == IP_VERSION_4) {\r
-    CopyMem (&Local, &TcpAp->Tcp4Ap.StationAddress, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&Local, &TcpAp->Tcp4Ap.StationAddress);\r
     Port       = &TcpAp->Tcp4Ap.StationPort;\r
     RandomPort = &mTcp4RandomPort;\r
   } else {\r
@@ -495,12 +496,14 @@ TcpConfigurePcb (
     IpCfgData.Ip4CfgData.TypeOfService      = CfgData->Tcp4CfgData.TypeOfService;\r
     IpCfgData.Ip4CfgData.TimeToLive         = CfgData->Tcp4CfgData.TimeToLive;\r
     IpCfgData.Ip4CfgData.UseDefaultAddress  = CfgData->Tcp4CfgData.AccessPoint.UseDefaultAddress;\r
-    IpCfgData.Ip4CfgData.SubnetMask         = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;\r
+    IP4_COPY_ADDRESS (\r
+      &IpCfgData.Ip4CfgData.SubnetMask,\r
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask\r
+      );\r
     IpCfgData.Ip4CfgData.ReceiveTimeout     = (UINT32) (-1);\r
-    CopyMem (\r
+    IP4_COPY_ADDRESS (\r
       &IpCfgData.Ip4CfgData.StationAddress,\r
-      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,\r
-      sizeof (EFI_IPv4_ADDRESS)\r
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress\r
       );\r
 \r
   } else {\r
@@ -533,8 +536,14 @@ TcpConfigurePcb (
     //\r
     // Get the default address information if the instance is configured to use default address.\r
     //\r
-    CfgData->Tcp4CfgData.AccessPoint.StationAddress = IpCfgData.Ip4CfgData.StationAddress;\r
-    CfgData->Tcp4CfgData.AccessPoint.SubnetMask     = IpCfgData.Ip4CfgData.SubnetMask;\r
+    IP4_COPY_ADDRESS (\r
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,\r
+      &IpCfgData.Ip4CfgData.StationAddress\r
+      );\r
+    IP4_COPY_ADDRESS (\r
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask,\r
+      &IpCfgData.Ip4CfgData.SubnetMask\r
+      );\r
 \r
     TcpAp = (TCP_ACCESS_POINT *) &CfgData->Tcp4CfgData.AccessPoint;\r
   } else {\r
@@ -601,7 +610,7 @@ TcpConfigurePcb (
 \r
     CopyMem (&Tcb->LocalEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.StationAddress, sizeof (IP4_ADDR));\r
     Tcb->LocalEnd.Port  = HTONS (CfgData->Tcp4CfgData.AccessPoint.StationPort);\r
-    Tcb->SubnetMask     = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;\r
+    IP4_COPY_ADDRESS (&Tcb->SubnetMask, &CfgData->Tcp4CfgData.AccessPoint.SubnetMask);\r
 \r
     CopyMem (&Tcb->RemoteEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.RemoteAddress, sizeof (IP4_ADDR));\r
     Tcb->RemoteEnd.Port = HTONS (CfgData->Tcp4CfgData.AccessPoint.RemotePort);\r
index 3c103444bd10681f525ee43a08398831daa29d5a..66a09c41eaa77a68a930e5c6e10fbec0ff809179 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Implementation of EFI_TCP4_PROTOCOL and EFI_TCP6_PROTOCOL.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -229,9 +230,9 @@ Tcp4Routes (
   Sock                      = SOCK_FROM_THIS (This);\r
 \r
   RouteInfo.DeleteRoute     = DeleteRoute;\r
-  RouteInfo.SubnetAddress   = SubnetAddress;\r
-  RouteInfo.SubnetMask      = SubnetMask;\r
-  RouteInfo.GatewayAddress  = GatewayAddress;\r
+  IP4_COPY_ADDRESS (&RouteInfo.SubnetAddress, &SubnetAddress);\r
+  IP4_COPY_ADDRESS (&RouteInfo.SubnetMask, &SubnetMask);\r
+  IP4_COPY_ADDRESS (&RouteInfo.GatewayAddress, &GatewayAddress);\r
 \r
   return SockRoute (Sock, &RouteInfo);\r
 }\r
index 5394f7d1cadceff4f5bc0687a50fcaabd08d9836..0a4eda37c892225380be1fb753e5fd9ceb269340 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Misc support routines for TCP driver.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -428,7 +429,6 @@ TcpInsertTcb (
   LIST_ENTRY       *Entry;\r
   LIST_ENTRY       *Head;\r
   TCP_CB           *Node;\r
-  TCP_PROTO_DATA  *TcpProto;\r
 \r
   ASSERT (\r
     (Tcb != NULL) &&\r
@@ -466,7 +466,6 @@ TcpInsertTcb (
 \r
   InsertHeadList (Head, &Tcb->List);\r
 \r
-  TcpProto = (TCP_PROTO_DATA *) Tcb->Sk->ProtoReserved;\r
 \r
   return 0;\r
 }\r
index b71998b405552c4ab08027840561511c3645afff..111224cea2e2ae53452bd90c2b4c7b56cacd5ea5 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Functions implementation related with DHCPv6 for UefiPxeBc Driver.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -664,7 +665,6 @@ PxeBcRequestBootService (
 {\r
   EFI_PXE_BASE_CODE_UDP_PORT          SrcPort;\r
   EFI_PXE_BASE_CODE_UDP_PORT          DestPort;\r
-  EFI_PXE_BASE_CODE_MODE              *Mode;\r
   EFI_PXE_BASE_CODE_PROTOCOL          *PxeBc;\r
   EFI_PXE_BASE_CODE_DHCPV6_PACKET     *Discover;\r
   UINTN                               DiscoverLen;\r
@@ -682,7 +682,6 @@ PxeBcRequestBootService (
   UINT8                               *Option;\r
 \r
   PxeBc       = &Private->PxeBc;\r
-  Mode        = PxeBc->Mode;\r
   Request     = Private->Dhcp6Request;\r
   ProxyOffer = &Private->OfferBuffer[Index].Dhcp6.Packet.Offer;\r
   SrcPort     = PXEBC_BS_DISCOVER_PORT;\r
index 8ee831f521a5324c3c07d4d02e944ca2702b908b..92fd1f19df64bc9ebbf972a58dcc96adb7a5b306 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Driver Binding functions implementationfor for UefiPxeBc Driver.\r
 \r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -1400,7 +1401,6 @@ PxeBcStop (
   EFI_LOAD_FILE_PROTOCOL          *LoadFile;\r
   EFI_STATUS                      Status;\r
   EFI_HANDLE                      NicHandle;\r
-  BOOLEAN                         IsIpv6;\r
   PXEBC_PRIVATE_PROTOCOL          *Id;\r
 \r
   Private    = NULL;\r
@@ -1408,7 +1408,6 @@ PxeBcStop (
   VirtualNic = NULL;\r
   LoadFile   = NULL;\r
   Id         = NULL;\r
-  IsIpv6     = FALSE;\r
 \r
   Status = gBS->OpenProtocol (\r
                   ControllerHandle,\r