mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-28 04:13:35 +00:00
[CPORTLIB/FREELDR]
GetByte --> Wait for data (with timeout) and get it if available. PollByte --> Check for data, get it if available, and return immediately. svn path=/trunk/; revision=57780
This commit is contained in:
@@ -100,7 +100,7 @@ BOOLEAN Rs232PortGetByte(PUCHAR ByteReceived)
|
||||
if (PortInitialized == FALSE)
|
||||
return FALSE;
|
||||
|
||||
return (CpGetByte(&Rs232ComPort, ByteReceived, FALSE, FALSE) == CP_GET_SUCCESS);
|
||||
return (CpGetByte(&Rs232ComPort, ByteReceived, TRUE) == CP_GET_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -109,12 +109,7 @@ BOOLEAN Rs232PortPollByte(PUCHAR ByteReceived)
|
||||
if (PortInitialized == FALSE)
|
||||
return FALSE;
|
||||
|
||||
while ((READ_PORT_UCHAR (SER_LSR(Rs232PortBase)) & SR_LSR_DR) == 0)
|
||||
;
|
||||
|
||||
*ByteReceived = READ_PORT_UCHAR (SER_RBR(Rs232PortBase));
|
||||
|
||||
return TRUE;
|
||||
return (CpGetByte(&Rs232ComPort, ByteReceived, FALSE) == CP_GET_SUCCESS);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ BOOLEAN
|
||||
WinLdrPortGetByte(IN ULONG PortId,
|
||||
OUT PUCHAR Data)
|
||||
{
|
||||
return CpGetByte(&Port[PortId], Data, TRUE, FALSE) == CP_GET_SUCCESS;
|
||||
return CpGetByte(&Port[PortId], Data, TRUE) == CP_GET_SUCCESS;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
@@ -151,7 +151,7 @@ WinLdrPortPollOnly(IN ULONG PortId)
|
||||
{
|
||||
UCHAR Dummy;
|
||||
|
||||
return CpGetByte(&Port[PortId], &Dummy, FALSE, TRUE) == CP_GET_SUCCESS;
|
||||
return CpGetByte(&Port[PortId], &Dummy, FALSE) == CP_GET_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
||||
@@ -69,8 +69,7 @@ NTAPI
|
||||
CpGetByte(
|
||||
IN PCPPORT Port,
|
||||
OUT PUCHAR Byte,
|
||||
IN BOOLEAN Wait,
|
||||
IN BOOLEAN Poll
|
||||
IN BOOLEAN Wait
|
||||
);
|
||||
|
||||
VOID
|
||||
|
||||
@@ -255,8 +255,7 @@ USHORT
|
||||
NTAPI
|
||||
CpGetByte(IN PCPPORT Port,
|
||||
OUT PUCHAR Byte,
|
||||
IN BOOLEAN Wait,
|
||||
IN BOOLEAN Poll)
|
||||
IN BOOLEAN Wait)
|
||||
{
|
||||
UCHAR Lsr;
|
||||
ULONG LimitCount = Wait ? TIMEOUT_COUNT : 1;
|
||||
@@ -278,9 +277,6 @@ CpGetByte(IN PCPPORT Port,
|
||||
return CP_GET_ERROR;
|
||||
}
|
||||
|
||||
/* If only polling was requested by caller, return now */
|
||||
if (Poll) return CP_GET_SUCCESS;
|
||||
|
||||
/* Otherwise read the byte and return it */
|
||||
*Byte = READ_PORT_UCHAR(Port->Address + RECEIVE_BUFFER_REGISTER);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user