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 <randy_pawell@hp.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16471 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Randy Pawell
2014-12-04 00:32:24 +00:00
committed by erictian
parent 40a0f8cb78
commit 35f910f08b
10 changed files with 33 additions and 30 deletions

View File

@@ -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 @@ Udp4Configure (
// 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 @@ Udp4Transmit (
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 @@ Udp4Transmit (
// 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 @@ Udp4Transmit (
// 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));
}