reactos/ntoskrnl/kd/kdserial.c
Hermès Bélusca-Maïto f3dd713382
[NTOS:KD:KDBG] Isolate the read-line (prompt) functionality in a separate file.
Rename KdbpReadCommand as KdIoReadLine. Extract the last-command
repetition functionality out of KdIoReadLine and put it where it
belongs: only in the KDBG command main loop KdbpCliMainLoop.
2023-03-28 16:14:40 +02:00

39 lines
930 B
C

/*
* 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>
*/
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#include "kd.h"
/* 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 */