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>
This commit is contained in:
Ruiyu Ni 2016-02-24 16:02:18 +08:00
parent 4653749963
commit e90f51a822
1 changed files with 11 additions and 25 deletions

View File

@ -1819,6 +1819,14 @@ PciIoGetBarAttributes (
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_IO;
break;
case PciBarTypePMem32:
//
// prefechable
//
Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE;
//
// Fall through
//
case PciBarTypeMem32:
//
// Mem
@ -1830,21 +1838,14 @@ PciIoGetBarAttributes (
Descriptor->AddrSpaceGranularity = 32;
break;
case PciBarTypePMem32:
//
// Mem
//
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
case PciBarTypePMem64:
//
// prefechable
//
Descriptor->SpecificFlag = 0x6;
Descriptor->SpecificFlag = EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE;
//
// 32 bit
// Fall through
//
Descriptor->AddrSpaceGranularity = 32;
break;
case PciBarTypeMem64:
//
// Mem
@ -1856,21 +1857,6 @@ PciIoGetBarAttributes (
Descriptor->AddrSpaceGranularity = 64;
break;
case PciBarTypePMem64:
//
// Mem
//
Descriptor->ResType = ACPI_ADDRESS_SPACE_TYPE_MEM;
//
// prefechable
//
Descriptor->SpecificFlag = 0x6;
//
// 64 bit
//
Descriptor->AddrSpaceGranularity = 64;
break;
default:
break;
}