2008-03-09 14:11:42 +00:00
|
|
|
/*
|
2005-01-26 13:58:37 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
2015-10-04 11:54:25 +00:00
|
|
|
* FILE: ntoskrnl/kdbg/kdb_serial.c
|
2005-01-26 13:58:37 +00:00
|
|
|
* PURPOSE: Serial driver
|
2005-05-09 01:38:29 +00:00
|
|
|
*
|
2005-01-26 13:58:37 +00:00
|
|
|
* PROGRAMMERS: Victor Kirhenshtein (sauros@iname.com)
|
|
|
|
* Jason Filby (jasonfilby@yahoo.com)
|
|
|
|
* arty
|
2003-12-23 08:41:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ****************************************************************/
|
|
|
|
|
2004-08-15 16:39:12 +00:00
|
|
|
#include <ntoskrnl.h>
|
2003-12-23 08:41:14 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
CHAR
|
2007-09-05 21:32:04 +00:00
|
|
|
KdbpTryGetCharSerial(ULONG Retry)
|
2003-12-23 08:41:14 +00:00
|
|
|
{
|
2009-09-09 13:49:04 +00:00
|
|
|
CHAR Result = -1;
|
2003-12-23 08:41:14 +00:00
|
|
|
|
2009-09-09 13:49:04 +00:00
|
|
|
if (Retry == 0)
|
|
|
|
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result));
|
|
|
|
else
|
|
|
|
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result) && Retry-- > 0);
|
2003-12-23 08:41:14 +00:00
|
|
|
|
2009-09-09 13:49:04 +00:00
|
|
|
return Result;
|
2003-12-23 08:41:14 +00:00
|
|
|
}
|