X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=MdePkg%2FLibrary%2FPeiPciSegmentLibPciCfg2%2FPciSegmentLib.c;h=04284ebcae3c32f41d2bdf753cb1de55394a1810;hb=19388d2960b2fe0347da23799e93ccc52f540214;hp=332d2a9b45e7eb3d6eabf034806f5d6005e3cc58;hpb=59ceeabe504f4c7814f9560c411690a1ffdc31b2;p=mirror_edk2.git diff --git a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c index 332d2a9b45..04284ebcae 100644 --- a/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c +++ b/MdePkg/Library/PeiPciSegmentLibPciCfg2/PciSegmentLib.c @@ -1,8 +1,8 @@ /** @file PCI Segment Library implementation using PCI CFG2 PPI. - Copyright (c) 2007 - 2009, Intel Corporation All rights - reserved. This program and the accompanying materials are + Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1259,7 +1259,7 @@ PciSegmentReadBuffer ( // // Read a word if StartAddress is word aligned // - *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress); + WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress)); StartAddress += sizeof (UINT16); Size -= sizeof (UINT16); Buffer = (UINT16*)Buffer + 1; @@ -1269,7 +1269,7 @@ PciSegmentReadBuffer ( // // Read as many double words as possible // - *(volatile UINT32 *)Buffer = PciSegmentRead32 (StartAddress); + WriteUnaligned32 (Buffer, PciSegmentRead32 (StartAddress)); StartAddress += sizeof (UINT32); Size -= sizeof (UINT32); Buffer = (UINT32*)Buffer + 1; @@ -1279,7 +1279,7 @@ PciSegmentReadBuffer ( // // Read the last remaining word if exist // - *(volatile UINT16 *)Buffer = PciSegmentRead16 (StartAddress); + WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress)); StartAddress += sizeof (UINT16); Size -= sizeof (UINT16); Buffer = (UINT16*)Buffer + 1; @@ -1358,7 +1358,7 @@ PciSegmentWriteBuffer ( // // Write a word if StartAddress is word aligned // - PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer); + PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer)); StartAddress += sizeof (UINT16); Size -= sizeof (UINT16); Buffer = (UINT16*)Buffer + 1; @@ -1368,7 +1368,7 @@ PciSegmentWriteBuffer ( // // Write as many double words as possible // - PciSegmentWrite32 (StartAddress, *(UINT32*)Buffer); + PciSegmentWrite32 (StartAddress, ReadUnaligned32 (Buffer)); StartAddress += sizeof (UINT32); Size -= sizeof (UINT32); Buffer = (UINT32*)Buffer + 1; @@ -1378,7 +1378,7 @@ PciSegmentWriteBuffer ( // // Write the last remaining word if exist // - PciSegmentWrite16 (StartAddress, *(UINT16*)Buffer); + PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer)); StartAddress += sizeof (UINT16); Size -= sizeof (UINT16); Buffer = (UINT16*)Buffer + 1;