Merge 3 PCDs for the ISA Bus Driver to a single PCD that is a bitmask of features.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8861 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2009-07-10 07:01:42 +00:00
parent a4df47f109
commit 10c1a4ca0c
5 changed files with 30 additions and 28 deletions

View File

@ -17,6 +17,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "InternalIsaBus.h" #include "InternalIsaBus.h"
//
// Bits definition of PcdIsaBusSupportedFeatures
//
#define PCD_ISA_BUS_SUPPORT_DMA BIT0
#define PCD_ISA_BUS_ONLY_SUPPORT_SLAVE_DMA BIT1
#define PCD_ISA_BUS_SUPPORT_ISA_MEMORY BIT2
// //
// ISA I/O Support Function Prototypes // ISA I/O Support Function Prototypes
// //

View File

@ -65,9 +65,7 @@
gEfiDevicePathProtocolGuid # PROTOCOL TO_START gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiGenericMemTestProtocolGuid # PROTOCOL TO_START gEfiGenericMemTestProtocolGuid # PROTOCOL TO_START
[FeaturePcd.common] [Pcd.common]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusOnlySupportSlaveDma gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportDma
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportIsaMemory

View File

@ -353,9 +353,9 @@ IsaIoUnmap (
ISA_MAP_INFO *IsaMapInfo; ISA_MAP_INFO *IsaMapInfo;
// //
// Unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA. // Check if DMA is supported.
// //
if (!FeaturePcdGet (PcdIsaBusSupportDma)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_DMA) == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -512,10 +512,9 @@ IsaIoMemRead (
ISA_IO_DEVICE *IsaIoDevice; ISA_IO_DEVICE *IsaIoDevice;
// //
// Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for // Check if ISA memory is supported.
// ISA bus memory read/write operations.
// //
if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_ISA_MEMORY) == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -579,10 +578,9 @@ IsaIoMemWrite (
ISA_IO_DEVICE *IsaIoDevice; ISA_IO_DEVICE *IsaIoDevice;
// //
// Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for // Check if ISA memory is supported.
// ISA bus memory read/write operations.
// //
if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_ISA_MEMORY) == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -646,10 +644,9 @@ IsaIoCopyMem (
ISA_IO_DEVICE *IsaIoDevice; ISA_IO_DEVICE *IsaIoDevice;
// //
// Set Feature Flag PcdIsaBusSupportIsaMemory to FALSE to disable support for // Check if ISA memory is supported.
// ISA bus memory read/write operations.
// //
if (!FeaturePcdGet (PcdIsaBusSupportIsaMemory)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_ISA_MEMORY) == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -1297,9 +1294,9 @@ IsaIoMap (
) )
{ {
// //
// Set Feature Flag PcdIsaBusSupportDma to FALSE to disable support for ISA DMA. // Check if DMA is supported.
// //
if (!FeaturePcdGet (PcdIsaBusSupportDma)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_DMA) == 0) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
// //
@ -1308,7 +1305,7 @@ IsaIoMap (
// //
// So we just return EFI_UNSUPPORTED for these functions. // So we just return EFI_UNSUPPORTED for these functions.
// //
if (FeaturePcdGet (PcdIsaBusOnlySupportSlaveDma)) { if ((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_ONLY_SUPPORT_SLAVE_DMA) != 0) {
return IsaIoMapOnlySupportSlaveReadWrite ( return IsaIoMapOnlySupportSlaveReadWrite (
This, This,
Operation, Operation,
@ -1369,7 +1366,8 @@ IsaIoAllocateBuffer (
// ISA Bus Master. // ISA Bus Master.
// Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA. // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.
// //
if (!FeaturePcdGet (PcdIsaBusSupportDma) || FeaturePcdGet (PcdIsaBusOnlySupportSlaveDma)) { if (((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_DMA) == 0) ||
((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_ONLY_SUPPORT_SLAVE_DMA) != 0)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -1439,7 +1437,8 @@ IsaIoFreeBuffer (
// ISA Bus Master. // ISA Bus Master.
// Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA. // Or unset Feature Flag PcdIsaBusSupportDma to disable support for ISA DMA.
// //
if (!FeaturePcdGet (PcdIsaBusSupportDma) || FeaturePcdGet (PcdIsaBusOnlySupportSlaveDma)) { if (((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_SUPPORT_DMA) == 0) ||
((PcdGet8 (PcdIsaBusSupportedFeatures) & PCD_ISA_BUS_ONLY_SUPPORT_SLAVE_DMA) != 0)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }

View File

@ -123,11 +123,6 @@
## This PCD specifies whether PciBus supports the hot plug device. ## This PCD specifies whether PciBus supports the hot plug device.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE|BOOLEAN|0x0001003d gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE|BOOLEAN|0x0001003d
## ISA bus related PCDs to support DMA, SlaveDMA and Memory feature.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportDma|TRUE|BOOLEAN|0x00010040
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusOnlySupportSlaveDma|FALSE|BOOLEAN|0x00010041
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportIsaMemory|TRUE|BOOLEAN|0x00010042
[PcdsFixedAtBuild] [PcdsFixedAtBuild]
## FFS filename to find the default BMP Logo file. ## FFS filename to find the default BMP Logo file.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile |{ 0x99, 0x8b, 0xB2, 0x7B, 0xBB, 0x61, 0xD5, 0x11, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }|VOID*|16 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile |{ 0x99, 0x8b, 0xB2, 0x7B, 0xBB, 0x61, 0xD5, 0x11, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }|VOID*|16
@ -135,6 +130,12 @@
## FFS filename to find the shell application. ## FFS filename to find the shell application.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0xB7, 0xD6, 0x7A, 0xC5, 0x15, 0x05, 0xA8, 0x40, 0x9D, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4E, 0x37 }|VOID*|16 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0xB7, 0xD6, 0x7A, 0xC5, 0x15, 0x05, 0xA8, 0x40, 0x9D, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4E, 0x37 }|VOID*|16
## ISA bus related PCD to support DMA, SlaveDMA and ISA Memory features.
# BIT0 indicates if DMA is supported
# BIT1 indicates if only slave DMA is supported
# BIT2 indicates if ISA memory is supported
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures|0x05|UINT8|0x00010040
[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic] [PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic]
## PcdStatusCodeMemorySize is used when PcdStatusCodeUseMemory is set to true ## PcdStatusCodeMemorySize is used when PcdStatusCodeUseMemory is set to true
# (PcdStatusCodeMemorySize * KBytes) is the total taken memory size. # (PcdStatusCodeMemorySize * KBytes) is the total taken memory size.

View File

@ -131,9 +131,6 @@
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|FALSE gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|FALSE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportDma|TRUE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusOnlySupportSlaveDma|FALSE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportIsaMemory|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000