reactos/ntoskrnl/kd/kdserial.c

39 lines
930 B
C
Raw Normal View History

/*
2023-03-26 00:32:33 +00:00
* PROJECT: ReactOS KDBG Kernel Debugger Terminal Driver
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Serial driver
* COPYRIGHT: Copyright 2004 Art Yerkes <ayerkes@speakeasy.net>
* Copyright 2005 Gregor Anich <blight@blight.eu.org>
*/
2023-03-26 00:32:33 +00:00
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#include "kd.h"
2023-03-26 00:32:33 +00:00
/* FUNCTIONS *****************************************************************/
VOID
KdbpSendCommandSerial(
_In_ PCSTR Command)
{
while (*Command)
KdPortPutByteEx(&SerialPortInfo, *Command++);
}
CHAR
KdbpTryGetCharSerial(
_In_ ULONG Retry)
{
CHAR Result = -1;
if (Retry == 0)
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result));
else
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result) && Retry-- > 0);
return Result;
}
/* EOF */