Replace Fixed PCD with Feature PCD for useHalfHandshake to reduce code size.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8862 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy 2009-07-10 07:55:14 +00:00
parent 10c1a4ca0c
commit 77b91d896f
5 changed files with 13 additions and 13 deletions

View File

@ -65,4 +65,6 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
[FeaturePcd.common]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE

View File

@ -83,8 +83,7 @@ SERIAL_DEV gSerialDevTempate = {
FALSE,
FALSE,
Uart16550A,
NULL,
FixedPcdGetBool (PcdIsaBusSerialUseHalfHandshake) //UseHalfHandshake
NULL
};
/**
@ -807,7 +806,7 @@ IsaSerialReceiveTransmit (
// if receive buffer is available.
//
if (SerialDevice->HardwareFlowControl &&
!SerialDevice->UseHalfHandshake &&
!FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake)&&
!ReceiveFifoFull
) {
Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
@ -844,7 +843,7 @@ IsaSerialReceiveTransmit (
// tell the peer to stop sending data.
//
if (SerialDevice->HardwareFlowControl &&
!SerialDevice->UseHalfHandshake &&
!FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake) &&
IsaSerialFifoFull (&SerialDevice->Receive)
) {
Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
@ -873,7 +872,7 @@ IsaSerialReceiveTransmit (
//
// For half handshake flow control assert RTS before sending.
//
if (SerialDevice->UseHalfHandshake) {
if (FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake)) {
Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
Mcr.Bits.Rts= 0;
WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);
@ -883,7 +882,7 @@ IsaSerialReceiveTransmit (
//
TimeOut = 0;
Msr.Data = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
while (Msr.Bits.Dcd == 1 && (!Msr.Bits.Cts ^ SerialDevice->UseHalfHandshake)) {
while (Msr.Bits.Dcd == 1 && (!Msr.Bits.Cts ^ FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {
gBS->Stall (TIMEOUT_STALL_INTERVAL);
TimeOut++;
if (TimeOut > 5) {
@ -893,7 +892,7 @@ IsaSerialReceiveTransmit (
Msr.Data = READ_MSR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
}
if (Msr.Bits.Dcd== 0 || (Msr.Bits.Cts ^ SerialDevice->UseHalfHandshake)) {
if (Msr.Bits.Dcd== 0 || (Msr.Bits.Cts ^ FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake))) {
IsaSerialFifoRemove (&SerialDevice->Transmit, &Data);
WRITE_THR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Data);
}
@ -901,7 +900,7 @@ IsaSerialReceiveTransmit (
//
// For half handshake flow control, tell DCE we are done.
//
if (SerialDevice->UseHalfHandshake) {
if (FeaturePcdGet(PcdIsaBusSerialUseHalfHandshake)) {
Mcr.Data = READ_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress);
Mcr.Bits.Rts = 1;
WRITE_MCR (SerialDevice->IsaIo, SerialDevice->BaseAddress, Mcr.Data);

View File

@ -109,7 +109,6 @@ typedef struct {
BOOLEAN HardwareFlowControl;
EFI_UART_TYPE Type;
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
BOOLEAN UseHalfHandshake;
} SERIAL_DEV;
#define SERIAL_DEV_FROM_THIS(a) CR (a, SERIAL_DEV, SerialIo, SERIAL_DEV_SIGNATURE)

View File

@ -123,6 +123,9 @@
## This PCD specifies whether PciBus supports the hot plug device.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE|BOOLEAN|0x0001003d
## This PCD specifies whether Serial device use half hand shake.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE|BOOLEAN|0x00010043
[PcdsFixedAtBuild]
## 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
@ -143,9 +146,6 @@
# The default value in DxePhase is 128 KBytes.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1|UINT16|0x00010025
## This PCD specifies whether Serial device use half hand shake.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE|BOOLEAN|0x00010043
[PcdsDynamic]
## PCD is used to mark if the machine has complete one boot cycle before.
# After the complete boot, the variable BootState will be set to TRUE.

View File

@ -131,6 +131,7 @@
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|FALSE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport|TRUE
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE
[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
@ -150,7 +151,6 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|0
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE
[PcdsDynamicDefault.PEIM.DEFAULT]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1