mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 13:33:32 +08:00
f3dd713382
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.
39 lines
930 B
C
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 */
|