Revision: 16471
http://sourceforge.net/p/edk2/code/16471
Author: erictian
Date: 2014-12-04 00:32:24 +0000 (Thu, 04 Dec 2014)
Log Message:
-----------
MdeModulePkg: 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.
- Fix a EFI_INPUT_KEY usage in TerminalDxe to use CopyMem() to copy the
structure instead of direct assignment, to avoid runtime alignment error.
- Delete excess local variables that are initialized but otherwise unused.
- CompilerIntrinsicsLib library now imported for AARCH64, as well as ARM.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Randy Pawell <[email protected]>
Reviewed-by: Olivier Martin <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
trunk/edk2/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
trunk/edk2/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
trunk/edk2/MdeModulePkg/MdeModulePkg.dsc
trunk/edk2/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
trunk/edk2/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
Modified: trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -2,6 +2,7 @@
NvmExpressDxe driver is used to manage non-volatile memory subsystem which
follows
NVM Express specification.
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -852,7 +853,6 @@
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
{
- NVME_CONTROLLER_PRIVATE_DATA *Private;
NVME_NAMESPACE_DEVICE_PATH *Node;
//
@@ -862,8 +862,6 @@
return EFI_INVALID_PARAMETER;
}
- Private = NVME_CONTROLLER_PRIVATE_DATA_FROM_PASS_THRU (This);
-
if (NamespaceId == 0) {
return EFI_NOT_FOUND;
}
Modified:
trunk/edk2/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
===================================================================
---
trunk/edk2/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
2014-12-03 15:34:08 UTC (rev 16470)
+++
trunk/edk2/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
16550 UART Serial Port library functions
+ (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -184,7 +185,6 @@
)
{
UINTN PciLibAddress;
- UINTN PrimaryBusNumber;
UINTN BusNumber;
UINTN SubordinateBusNumber;
UINT32 ParentIoBase;
@@ -233,7 +233,6 @@
//
// Retrieve and verify the bus numbers in the PCI to PCI Bridge
//
- PrimaryBusNumber = PciRead8 (PciLibAddress +
PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET);
BusNumber = PciRead8 (PciLibAddress +
PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET);
SubordinateBusNumber = PciRead8 (PciLibAddress +
PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET);
if (BusNumber == 0 || BusNumber > SubordinateBusNumber) {
Modified: trunk/edk2/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 2014-12-03
15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c 2014-12-04
00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
IpIo Library.
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -703,7 +704,7 @@
Ip4TxData = &TxData->Ip4TxData;
- CopyMem (&Ip4TxData->DestinationAddress, Dest, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&Ip4TxData->DestinationAddress, Dest);
Ip4TxData->OverrideData = &OverrideData->Ip4OverrideData;
Ip4TxData->OptionsLength = 0;
@@ -1765,8 +1766,8 @@
NULL
);
- ((EFI_IP4_CONFIG_DATA*) IpConfigData)->StationAddress =
Ip4ModeData.ConfigData.StationAddress;
- ((EFI_IP4_CONFIG_DATA*) IpConfigData)->SubnetMask =
Ip4ModeData.ConfigData.SubnetMask;
+ IP4_COPY_ADDRESS (&((EFI_IP4_CONFIG_DATA*)
IpConfigData)->StationAddress, &Ip4ModeData.ConfigData.StationAddress);
+ IP4_COPY_ADDRESS (&((EFI_IP4_CONFIG_DATA*) IpConfigData)->SubnetMask,
&Ip4ModeData.ConfigData.SubnetMask);
}
CopyMem (
Modified: trunk/edk2/MdeModulePkg/MdeModulePkg.dsc
===================================================================
--- trunk/edk2/MdeModulePkg/MdeModulePkg.dsc 2014-12-03 15:34:08 UTC (rev
16470)
+++ trunk/edk2/MdeModulePkg/MdeModulePkg.dsc 2014-12-04 00:32:24 UTC (rev
16471)
@@ -1,6 +1,7 @@
## @file
# EFI/PI Reference Module Package for All Architectures
#
+# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
@@ -145,10 +146,10 @@
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
-[LibraryClasses.ARM]
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
#
- # It is not possible to prevent the ARM compiler for generic intrinsic
functions.
- # This library provides the instrinsic functions generate by a given
compiler.
+ # 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
Modified: trunk/edk2/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/CapsulePei/Common/CapsuleCoalesce.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -9,6 +9,7 @@
CapsuleDataCoalesce() will do basic validation before coalesce capsule data
into memory.
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -960,7 +961,6 @@
UINT8 *DestPtr;
UINTN DestLength;
UINT8 *RelocPtr;
- UINT64 *AddDataPtr;
UINTN CapsuleTimes;
UINT64 SizeLeft;
UINT64 CapsuleImageSize;
@@ -986,7 +986,6 @@
CapsuleTimes = 0;
CapsuleImageSize = 0;
PrivateDataPtr = NULL;
- AddDataPtr = NULL;
CapsuleHeader = NULL;
CapsuleBeginFlag = TRUE;
CapsuleSize = 0;
Modified: trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -847,7 +848,7 @@
return FALSE;
}
- *Output = TerminalDevice->EfiKeyFiFo->Data[Head];
+ CopyMem (Output, &TerminalDevice->EfiKeyFiFo->Data[Head], sizeof
(EFI_INPUT_KEY));
TerminalDevice->EfiKeyFiFo->Head = (UINT8) ((Head + 1) % (FIFO_MAX_NUMBER +
1));
Modified: trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
Interface routine for Mtftp4.
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -305,13 +306,13 @@
UdpConfig.ReceiveTimeout = 0;
UdpConfig.TransmitTimeout = 0;
UdpConfig.UseDefaultAddress = Config->UseDefaultSetting;
- UdpConfig.StationAddress = Config->StationIp;
- UdpConfig.SubnetMask = Config->SubnetMask;
+ IP4_COPY_ADDRESS (&UdpConfig.StationAddress, &Config->StationIp);
+ IP4_COPY_ADDRESS (&UdpConfig.SubnetMask, &Config->SubnetMask);
UdpConfig.StationPort = 0;
UdpConfig.RemotePort = 0;
Ip = HTONL (Instance->ServerIp);
- CopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&UdpConfig.RemoteAddress, &Ip);
Status = UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfig);
Modified: trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
Routines to process Rrq (download).
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -413,13 +414,13 @@
UdpConfig.ReceiveTimeout = 0;
UdpConfig.TransmitTimeout = 0;
UdpConfig.UseDefaultAddress = Config->UseDefaultSetting;
- UdpConfig.StationAddress = Config->StationIp;
- UdpConfig.SubnetMask = Config->SubnetMask;
+ IP4_COPY_ADDRESS (&UdpConfig.StationAddress, &Config->StationIp);
+ IP4_COPY_ADDRESS (&UdpConfig.SubnetMask, &Config->SubnetMask);
UdpConfig.StationPort = Instance->McastPort;
UdpConfig.RemotePort = 0;
Ip = HTONL (Instance->ServerIp);
- CopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&UdpConfig.RemoteAddress, &Ip);
Status = McastIo->Protocol.Udp4->Configure (McastIo->Protocol.Udp4,
&UdpConfig);
@@ -451,7 +452,7 @@
// join the multicast group
//
Ip = HTONL (Instance->McastIp);
- CopyMem (&Group, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&Group, &Ip);
return McastIo->Protocol.Udp4->Groups (McastIo->Protocol.Udp4, TRUE, &Group);
}
Modified: trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,6 +1,7 @@
/** @file
Tcp request dispatcher implementation.
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -101,11 +102,11 @@
AccessPoint->UseDefaultAddress = Tcb->UseDefaultAddr;
- CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof
(EFI_IPv4_ADDRESS));
- AccessPoint->SubnetMask = Tcb->SubnetMask;
+ IP4_COPY_ADDRESS (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip);
+ 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);
@@ -458,7 +459,7 @@
CopyMem (&Tcb->LocalEnd.Ip, &CfgData->AccessPoint.StationAddress, sizeof
(IP4_ADDR));
Tcb->LocalEnd.Port = HTONS (CfgData->AccessPoint.StationPort);
- Tcb->SubnetMask = CfgData->AccessPoint.SubnetMask;
+ IP4_COPY_ADDRESS (&Tcb->SubnetMask, &CfgData->AccessPoint.SubnetMask);
if (CfgData->AccessPoint.ActiveFlag) {
CopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof
(IP4_ADDR));
Modified: trunk/edk2/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
2014-12-03 15:34:08 UTC (rev 16470)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
2014-12-04 00:32:24 UTC (rev 16471)
@@ -1,5 +1,6 @@
/** @file
+(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -227,8 +228,8 @@
// Save the configuration data.
//
CopyMem (&Instance->ConfigData, UdpConfigData, sizeof
(Instance->ConfigData));
- Instance->ConfigData.StationAddress = Ip4ConfigData.StationAddress;
- Instance->ConfigData.SubnetMask = Ip4ConfigData.SubnetMask;
+ IP4_COPY_ADDRESS (&Instance->ConfigData.StationAddress,
&Ip4ConfigData.StationAddress);
+ IP4_COPY_ADDRESS (&Instance->ConfigData.SubnetMask,
&Ip4ConfigData.SubnetMask);
//
// Try to allocate the required port resource.
@@ -588,7 +589,7 @@
Udp4Header->Checksum = 0;
UdpSessionData = TxData->UdpSessionData;
- Override.Ip4OverrideData.SourceAddress = ConfigData->StationAddress;
+ IP4_COPY_ADDRESS (&Override.Ip4OverrideData.SourceAddress,
&ConfigData->StationAddress);
if (UdpSessionData != NULL) {
//
@@ -596,7 +597,7 @@
// UdpSessionData.
//
if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) {
- CopyMem (&Override.Ip4OverrideData.SourceAddress,
&UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&Override.Ip4OverrideData.SourceAddress,
&UdpSessionData->SourceAddress);
}
if (UdpSessionData->SourcePort != 0) {
@@ -643,7 +644,7 @@
// Fill the IpIo Override data.
//
if (TxData->GatewayAddress != NULL) {
- CopyMem (&Override.Ip4OverrideData.GatewayAddress, TxData->GatewayAddress,
sizeof (EFI_IPv4_ADDRESS));
+ IP4_COPY_ADDRESS (&Override.Ip4OverrideData.GatewayAddress,
TxData->GatewayAddress);
} else {
ZeroMem (&Override.Ip4OverrideData.GatewayAddress, sizeof
(EFI_IPv4_ADDRESS));
}
------------------------------------------------------------------------------
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