diff options
Diffstat (limited to 'EdkModulePkg')
-rw-r--r-- | EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa | 27 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c | 41 | ||||
-rw-r--r-- | EdkModulePkg/EdkModulePkg.spd | 20 | ||||
-rw-r--r-- | EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 21 |
4 files changed, 93 insertions, 16 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa index f6c017cd76..4fe1dac4a9 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.msa @@ -6,14 +6,14 @@ <GuidValue>93B80004-9FB3-11d4-9A3A-0090273FC14D</GuidValue>
<Version>1.0</Version>
<Abstract>Component description file for PciBus module.</Abstract>
- <Description>PCI bus driver. This module will probe all PCI devices and allocate MMIO and IO
+ <Description>PCI bus driver. This module will probe all PCI devices and allocate MMIO and IO space for these devices.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
- <License>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
- http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ <License>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 + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
@@ -56,6 +56,9 @@ <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PeCoffGetEntryPointLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>PcdLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>PciBus.h</Filename>
@@ -160,4 +163,16 @@ <ComponentName>gPciBusComponentName</ComponentName>
</Extern>
</Externs>
+ <PcdCoded>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdPciIsaEnable</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>Whether ISA decoding is enabled on this platform so we should avoid those aliased resources</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdPciVgaEnable</C_Name>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>Whether VGA decoding is enabled on this platform so we should avoid those aliased resources</HelpText>
+ </PcdEntry>
+ </PcdCoded>
</ModuleSurfaceArea>
\ No newline at end of file diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c index 8919b422a7..58dbc9fd4c 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciResourceSupport.c @@ -241,11 +241,24 @@ Returns: LIST_ENTRY *CurrentLink;
PCI_RESOURCE_NODE *Node;
UINT64 offset;
+ BOOLEAN IsaEnable;
+ BOOLEAN VGAEnable;
//
// Always assume there is ISA device and VGA device on the platform
// will be customized later
//
+ IsaEnable = FALSE;
+ VGAEnable = FALSE;
+
+ if (FeaturePcdGet (PcdPciIsaEnable)){
+ IsaEnable = TRUE;
+ }
+
+ if (FeaturePcdGet (PcdPciVgaEnable)){
+ VGAEnable = TRUE;
+ }
+
Aperture = 0;
if (!Bridge) {
@@ -278,6 +291,34 @@ Returns: // become too limited to meet the requirement of most of devices.
//
+ if (IsaEnable || VGAEnable) {
+ if (!IS_PCI_BRIDGE (&(Node->PciDev->Pci)) && !IS_CARDBUS_BRIDGE (&(Node->PciDev->Pci))) {
+ //
+ // Check if there is need to support ISA/VGA decoding
+ // If so, we need to avoid isa/vga aliasing range
+ //
+ if (IsaEnable) {
+ SkipIsaAliasAperture (
+ &Aperture,
+ Node->Length
+ );
+ offset = Aperture & (Node->Alignment);
+ if (offset) {
+ Aperture = Aperture + (Node->Alignment + 1) - offset;
+ }
+ } else if (VGAEnable) {
+ SkipVGAAperture (
+ &Aperture,
+ Node->Length
+ );
+ offset = Aperture & (Node->Alignment);
+ if (offset) {
+ Aperture = Aperture + (Node->Alignment + 1) - offset;
+ }
+ }
+ }
+ }
+
Node->Offset = Aperture;
//
diff --git a/EdkModulePkg/EdkModulePkg.spd b/EdkModulePkg/EdkModulePkg.spd index 9a8861f838..da4eccebf5 100644 --- a/EdkModulePkg/EdkModulePkg.spd +++ b/EdkModulePkg/EdkModulePkg.spd @@ -16,7 +16,7 @@ <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</SpdHeader>
<PackageDefinitions>
- <ReadOnly>true</ReadOnly>
+ <ReadOnly>false</ReadOnly>
<RePackage>false</RePackage>
</PackageDefinitions>
<LibraryClassDeclarations>
@@ -1135,5 +1135,23 @@ <DefaultValue>FALSE</DefaultValue>
<HelpText>If TRUE, then the Device Path From Text Protocol should be produced by the platform</HelpText>
</PcdEntry>
+ <PcdEntry>
+ <C_Name>PcdPciIsaEnable</C_Name>
+ <Token>0x00010039</Token>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>BOOLEAN</DatumType>
+ <ValidUsage>FEATURE_FLAG</ValidUsage>
+ <DefaultValue>FALSE</DefaultValue>
+ <HelpText>This is a switch to enable ISA</HelpText>
+ </PcdEntry>
+ <PcdEntry>
+ <C_Name>PcdPciVgaEnable</C_Name>
+ <Token>0x0001003a</Token>
+ <TokenSpaceGuidCName>gEfiGenericPlatformTokenSpaceGuid</TokenSpaceGuidCName>
+ <DatumType>BOOLEAN</DatumType>
+ <ValidUsage>FEATURE_FLAG</ValidUsage>
+ <DefaultValue>FALSE</DefaultValue>
+ <HelpText>Whether VGA decoding is enabled on this platform so we should avoid those aliased resources</HelpText>
+ </PcdEntry>
</PcdDeclarations>
</PackageSurfaceArea>
\ No newline at end of file diff --git a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 178fa1ea59..5d631a5368 100644 --- a/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -15,7 +15,7 @@ Module Name: Abstract:
- Provide support functions for variable services.
+Revision History
--*/
@@ -125,8 +125,7 @@ Arguments: Returns:
- EFI_INVALID_PARAMETER - Parameters not valid
- EFI_SUCCESS - Variable store successfully updated
+ EFI STATUS
--*/
{
@@ -177,10 +176,11 @@ Returns: if ((DataPtr + DataSize) >= ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) {
return EFI_INVALID_PARAMETER;
}
-
- //
- // If Volatile Variable just do a simple mem copy.
- //
+ }
+ //
+ // If Volatile Variable just do a simple mem copy.
+ //
+ if (Volatile) {
CopyMem ((UINT8 *) ((UINTN) DataPtr), Buffer, DataSize);
return EFI_SUCCESS;
}
@@ -212,7 +212,9 @@ Returns: &CurrWriteSize,
CurrBuffer
);
- return Status;
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
} else {
Size = (UINT32) (LinearOffset + PtrBlockMapEntry->BlockLength - CurrWritePtr);
Status = EfiFvbWriteBlock (
@@ -813,7 +815,8 @@ Returns: // The size of the VariableName, including the Unicode Null in bytes plus
// the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
//
- else if (sizeof (VARIABLE_HEADER) + ArrayLength (VariableName) + DataSize > MAX_VARIABLE_SIZE) {
+ else if ((DataSize > MAX_VARIABLE_SIZE) ||
+ (sizeof (VARIABLE_HEADER) + ArrayLength (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
return EFI_INVALID_PARAMETER;
}
//
|