Revision: 16472
          http://sourceforge.net/p/edk2/code/16472
Author:   sfu5
Date:     2014-12-04 00:55:50 +0000 (Thu, 04 Dec 2014)
Log Message:
-----------
NetworkPkg: Source fixes and cleanup for ARMGCC compiles

- 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 <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
    trunk/edk2/NetworkPkg/Ip6Dxe/Ip6Impl.c
    trunk/edk2/NetworkPkg/NetworkPkg.dsc
    trunk/edk2/NetworkPkg/TcpDxe/TcpDispatcher.c
    trunk/edk2/NetworkPkg/TcpDxe/TcpMain.c
    trunk/edk2/NetworkPkg/TcpDxe/TcpMisc.c
    trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
    trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c

Modified: trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c
===================================================================
--- trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c    2014-12-04 00:32:24 UTC (rev 
16471)
+++ trunk/edk2/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c    2014-12-04 00:55:50 UTC (rev 
16472)
@@ -1,6 +1,7 @@
 /** @file
   Dhcp6 internal functions implementation.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -544,7 +545,6 @@
   )
 {
   EFI_STATUS                  Status;
-  EFI_DHCP6_STATE             State;
   UINT8                       *Option;
   UINT8                       *IaInnerOpt;
   UINT16                      IaInnerLen;
@@ -565,7 +565,6 @@
   //
   // See details in the section-18.1.8 of rfc-3315.
   //
-  State  = Dhcp6Init;
   Option = Dhcp6SeekIaOption (
              Packet->Dhcp6.Option,
              Packet->Length - sizeof (EFI_DHCP6_HEADER),
@@ -2428,14 +2427,12 @@
 {
   EFI_STATUS                  Status;
   UINT8                       *Option;
-  UINT16                      StsCode;
   BOOLEAN                     Timeout;
 
   ASSERT(Instance->Config);
   ASSERT(Instance->IaCb.Ia);
 
   Timeout = FALSE;
-  StsCode = Dhcp6StsSuccess;
 
   //
   // If the client does receives a valid reply message that includes a rapid

Modified: trunk/edk2/NetworkPkg/Ip6Dxe/Ip6Impl.c
===================================================================
--- trunk/edk2/NetworkPkg/Ip6Dxe/Ip6Impl.c      2014-12-04 00:32:24 UTC (rev 
16471)
+++ trunk/edk2/NetworkPkg/Ip6Dxe/Ip6Impl.c      2014-12-04 00:55:50 UTC (rev 
16472)
@@ -1,6 +1,7 @@
 /** @file
   Implementation of EFI_IP6_PROTOCOL protocol interfaces.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -1761,7 +1762,6 @@
   )
 {
   IP6_PROTOCOL              *IpInstance;
-  IP6_SERVICE               *IpSb;
   EFI_STATUS                Status;
   EFI_TPL                   OldTpl;
 
@@ -1770,7 +1770,6 @@
   }
 
   IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This);
-  IpSb       = IpInstance->Service;
 
   OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
 

Modified: trunk/edk2/NetworkPkg/NetworkPkg.dsc
===================================================================
--- trunk/edk2/NetworkPkg/NetworkPkg.dsc        2014-12-04 00:32:24 UTC (rev 
16471)
+++ trunk/edk2/NetworkPkg/NetworkPkg.dsc        2014-12-04 00:55:50 UTC (rev 
16472)
@@ -1,6 +1,7 @@
 ## @file
 # UEFI 2.4 Network Module Package for All Architectures
 #
+# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 #
 #    This program and the accompanying materials
@@ -19,7 +20,7 @@
   PLATFORM_VERSION               = 0.95
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/NetworkPkg
-  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64|EBC|ARM
+  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64|EBC|ARM|AARCH64
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT
 
@@ -57,6 +58,14 @@
   SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
   ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
 
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # It is not possible to prevent ARM compiler calls to generic intrinsic 
functions.
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [PcdsFeatureFlag]
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE

Modified: trunk/edk2/NetworkPkg/TcpDxe/TcpDispatcher.c
===================================================================
--- trunk/edk2/NetworkPkg/TcpDxe/TcpDispatcher.c        2014-12-04 00:32:24 UTC 
(rev 16471)
+++ trunk/edk2/NetworkPkg/TcpDxe/TcpDispatcher.c        2014-12-04 00:55:50 UTC 
(rev 16472)
@@ -1,6 +1,7 @@
 /** @file
   The implementation of a dispatch routine for processing TCP requests.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -98,12 +99,12 @@
 
     AccessPoint->UseDefaultAddress   = Tcb->UseDefaultAddr;
 
-    CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof 
(EFI_IPv4_ADDRESS));
+    IP4_COPY_ADDRESS (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip);
 
-    AccessPoint->SubnetMask          = Tcb->SubnetMask;
+    IP4_COPY_ADDRESS (&AccessPoint->SubnetMask, &Tcb->SubnetMask);
     AccessPoint->StationPort         = NTOHS (Tcb->LocalEnd.Port);
 
-    CopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof 
(EFI_IPv4_ADDRESS));
+    IP4_COPY_ADDRESS (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip);
 
     AccessPoint->RemotePort          = NTOHS (Tcb->RemoteEnd.Port);
     AccessPoint->ActiveFlag          = (BOOLEAN) (Tcb->State != TCP_LISTEN);
@@ -239,7 +240,7 @@
   UINT16          *RandomPort;
 
   if (IpVersion == IP_VERSION_4) {
-    CopyMem (&Local, &TcpAp->Tcp4Ap.StationAddress, sizeof (EFI_IPv4_ADDRESS));
+    IP4_COPY_ADDRESS (&Local, &TcpAp->Tcp4Ap.StationAddress);
     Port       = &TcpAp->Tcp4Ap.StationPort;
     RandomPort = &mTcp4RandomPort;
   } else {
@@ -495,12 +496,14 @@
     IpCfgData.Ip4CfgData.TypeOfService      = 
CfgData->Tcp4CfgData.TypeOfService;
     IpCfgData.Ip4CfgData.TimeToLive         = CfgData->Tcp4CfgData.TimeToLive;
     IpCfgData.Ip4CfgData.UseDefaultAddress  = 
CfgData->Tcp4CfgData.AccessPoint.UseDefaultAddress;
-    IpCfgData.Ip4CfgData.SubnetMask         = 
CfgData->Tcp4CfgData.AccessPoint.SubnetMask;
+    IP4_COPY_ADDRESS (
+      &IpCfgData.Ip4CfgData.SubnetMask,
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask
+      );
     IpCfgData.Ip4CfgData.ReceiveTimeout     = (UINT32) (-1);
-    CopyMem (
+    IP4_COPY_ADDRESS (
       &IpCfgData.Ip4CfgData.StationAddress,
-      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,
-      sizeof (EFI_IPv4_ADDRESS)
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress
       );
 
   } else {
@@ -533,8 +536,14 @@
     //
     // Get the default address information if the instance is configured to 
use default address.
     //
-    CfgData->Tcp4CfgData.AccessPoint.StationAddress = 
IpCfgData.Ip4CfgData.StationAddress;
-    CfgData->Tcp4CfgData.AccessPoint.SubnetMask     = 
IpCfgData.Ip4CfgData.SubnetMask;
+    IP4_COPY_ADDRESS (
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,
+      &IpCfgData.Ip4CfgData.StationAddress
+      );
+    IP4_COPY_ADDRESS (
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask,
+      &IpCfgData.Ip4CfgData.SubnetMask
+      );
 
     TcpAp = (TCP_ACCESS_POINT *) &CfgData->Tcp4CfgData.AccessPoint;
   } else {
@@ -601,7 +610,7 @@
 
     CopyMem (&Tcb->LocalEnd.Ip, 
&CfgData->Tcp4CfgData.AccessPoint.StationAddress, sizeof (IP4_ADDR));
     Tcb->LocalEnd.Port  = HTONS (CfgData->Tcp4CfgData.AccessPoint.StationPort);
-    Tcb->SubnetMask     = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;
+    IP4_COPY_ADDRESS (&Tcb->SubnetMask, 
&CfgData->Tcp4CfgData.AccessPoint.SubnetMask);
 
     CopyMem (&Tcb->RemoteEnd.Ip, 
&CfgData->Tcp4CfgData.AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
     Tcb->RemoteEnd.Port = HTONS (CfgData->Tcp4CfgData.AccessPoint.RemotePort);

Modified: trunk/edk2/NetworkPkg/TcpDxe/TcpMain.c
===================================================================
--- trunk/edk2/NetworkPkg/TcpDxe/TcpMain.c      2014-12-04 00:32:24 UTC (rev 
16471)
+++ trunk/edk2/NetworkPkg/TcpDxe/TcpMain.c      2014-12-04 00:55:50 UTC (rev 
16472)
@@ -1,6 +1,7 @@
 /** @file
   Implementation of EFI_TCP4_PROTOCOL and EFI_TCP6_PROTOCOL.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -229,9 +230,9 @@
   Sock                      = SOCK_FROM_THIS (This);
 
   RouteInfo.DeleteRoute     = DeleteRoute;
-  RouteInfo.SubnetAddress   = SubnetAddress;
-  RouteInfo.SubnetMask      = SubnetMask;
-  RouteInfo.GatewayAddress  = GatewayAddress;
+  IP4_COPY_ADDRESS (&RouteInfo.SubnetAddress, &SubnetAddress);
+  IP4_COPY_ADDRESS (&RouteInfo.SubnetMask, &SubnetMask);
+  IP4_COPY_ADDRESS (&RouteInfo.GatewayAddress, &GatewayAddress);
 
   return SockRoute (Sock, &RouteInfo);
 }

Modified: trunk/edk2/NetworkPkg/TcpDxe/TcpMisc.c
===================================================================
--- trunk/edk2/NetworkPkg/TcpDxe/TcpMisc.c      2014-12-04 00:32:24 UTC (rev 
16471)
+++ trunk/edk2/NetworkPkg/TcpDxe/TcpMisc.c      2014-12-04 00:55:50 UTC (rev 
16472)
@@ -1,6 +1,7 @@
 /** @file
   Misc support routines for TCP driver.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -428,7 +429,6 @@
   LIST_ENTRY       *Entry;
   LIST_ENTRY       *Head;
   TCP_CB           *Node;
-  TCP_PROTO_DATA  *TcpProto;
 
   ASSERT (
     (Tcb != NULL) &&
@@ -466,7 +466,6 @@
 
   InsertHeadList (Head, &Tcb->List);
 
-  TcpProto = (TCP_PROTO_DATA *) Tcb->Sk->ProtoReserved;
 
   return 0;
 }

Modified: trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
===================================================================
--- trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c     2014-12-04 00:32:24 UTC 
(rev 16471)
+++ trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c     2014-12-04 00:55:50 UTC 
(rev 16472)
@@ -1,6 +1,7 @@
 /** @file
   Functions implementation related with DHCPv6 for UefiPxeBc Driver.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -664,7 +665,6 @@
 {
   EFI_PXE_BASE_CODE_UDP_PORT          SrcPort;
   EFI_PXE_BASE_CODE_UDP_PORT          DestPort;
-  EFI_PXE_BASE_CODE_MODE              *Mode;
   EFI_PXE_BASE_CODE_PROTOCOL          *PxeBc;
   EFI_PXE_BASE_CODE_DHCPV6_PACKET     *Discover;
   UINTN                               DiscoverLen;
@@ -682,7 +682,6 @@
   UINT8                               *Option;
 
   PxeBc       = &Private->PxeBc;
-  Mode        = PxeBc->Mode;
   Request     = Private->Dhcp6Request;
   ProxyOffer = &Private->OfferBuffer[Index].Dhcp6.Packet.Offer;
   SrcPort     = PXEBC_BS_DISCOVER_PORT;

Modified: trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
===================================================================
--- trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c    2014-12-04 00:32:24 UTC 
(rev 16471)
+++ trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c    2014-12-04 00:55:50 UTC 
(rev 16472)
@@ -1,6 +1,7 @@
 /** @file
   Driver Binding functions implementationfor for UefiPxeBc Driver.
 
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
@@ -1400,7 +1401,6 @@
   EFI_LOAD_FILE_PROTOCOL          *LoadFile;
   EFI_STATUS                      Status;
   EFI_HANDLE                      NicHandle;
-  BOOLEAN                         IsIpv6;
   PXEBC_PRIVATE_PROTOCOL          *Id;
 
   Private    = NULL;
@@ -1408,7 +1408,6 @@
   VirtualNic = NULL;
   LoadFile   = NULL;
   Id         = NULL;
-  IsIpv6     = FALSE;
 
   Status = gBS->OpenProtocol (
                   ControllerHandle,


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to