Small Debugging Services re-arrangement. /dbgk created for User-Mode debugging and...
[reactos.git] / reactos / ntoskrnl / kdbg / kdb_serial.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/dbg/kdb_serial.c
6 * PURPOSE: Serial driver
7 *
8 * PROGRAMMERS: Victor Kirhenshtein (sauros@iname.com)
9 * Jason Filby (jasonfilby@yahoo.com)
10 * arty
11 */
12
13 /* INCLUDES ****************************************************************/
14
15 #include <ntoskrnl.h>
16 #define NDEBUG
17 #include <debug.h>
18
19 extern KD_PORT_INFORMATION LogPortInfo;
20
21
22 CHAR
23 KdbpTryGetCharSerial(UINT Retry)
24 {
25 CHAR Result = -1;
26
27 if (Retry == 0)
28 while (!KdPortGetByteEx(&LogPortInfo, (PUCHAR)&Result));
29 else
30 while (!KdPortGetByteEx(&LogPortInfo, (PUCHAR)&Result) && Retry-- > 0);
31
32 return Result;
33 }