summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-02-24 16:02:18 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-02-29 10:19:57 +0800
commite90f51a822c319b0e36bf55e260684239da325b4 (patch)
tree4604d81fce595c88fda39fa25341b62b5169acf3
parent4653749963ec27b505f8f0389bbc3d70403288fe (diff)
downloadedk2-e90f51a822c319b0e36bf55e260684239da325b4.tar.gz
edk2-e90f51a822c319b0e36bf55e260684239da325b4.tar.bz2
edk2-e90f51a822c319b0e36bf55e260684239da325b4.zip
MdeModulePkg/PciBus: reorganize case-statement to reduce code lines
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
index 020048d4ad..334a6ac309 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
@@ -1819,53 +1819,39 @@ PciIoGetBarAttributes (
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_IO;
break;
- case PciBarTypeMem32:
+ case PciBarTypePMem32:
//
- // Mem
+ // prefechable
//
- Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
+ Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE;
//
- // 32 bit
+ // Fall through
//
- Descriptor->AddrSpaceGranularity = 32;
- break;
-
- case PciBarTypePMem32:
+ case PciBarTypeMem32:
//
// Mem
//
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
//
- // prefechable
- //
- Descriptor->SpecificFlag = 0x6;
- //
// 32 bit
//
Descriptor->AddrSpaceGranularity = 32;
break;
- case PciBarTypeMem64:
+ case PciBarTypePMem64:
//
- // Mem
+ // prefechable
//
- Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
+ Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE;
//
- // 64 bit
+ // Fall through
//
- Descriptor->AddrSpaceGranularity = 64;
- break;
-
- case PciBarTypePMem64:
+ case PciBarTypeMem64:
//
// Mem
//
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
//
- // prefechable
- //
- Descriptor->SpecificFlag = 0x6;
- //
// 64 bit
//
Descriptor->AddrSpaceGranularity = 64;