ReactOS 0.4.15-dev-8109-gd7be748
kdserial.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: ntoskrnl/kd/arm/kdbg.c
5 * PURPOSE: Serial Port Kernel Debugging Transport Library
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <ntoskrnl.h>
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
18CPPORT DefaultPort = {0, 0, 0};
19
20//
21// We need to build this in the configuration root and use KeFindConfigurationEntry
22// to recover it later.
23//
24#define HACK 24000000
25
26/* REACTOS FUNCTIONS **********************************************************/
27
31 IN ULONG ComPortNumber)
32{
33 ULONG Divider, Remainder, Fraction;
34 ULONG Baudrate = PortInformation->BaudRate;
35
36 //
37 // Calculate baudrate clock divider and remainder
38 //
39 Divider = HACK / (16 * Baudrate);
40 Remainder = HACK % (16 * Baudrate);
41
42 //
43 // Calculate the fractional part
44 //
45 Fraction = (8 * Remainder / Baudrate) >> 1;
46 Fraction += (8 * Remainder / Baudrate) & 1;
47
48 //
49 // Disable interrupts
50 //
52
53 //
54 // Set the baud rate
55 //
58
59 //
60 // Set 8 bits for data, 1 stop bit, no parity, FIFO enabled
61 //
64
65 //
66 // Clear and enable FIFO
67 //
72
73 //
74 // Done
75 //
76 return TRUE;
77}
78
82 OUT PUCHAR ByteReceived)
83{
85 while (TRUE);
86 return FALSE;
87}
88
89VOID
92 IN UCHAR ByteToSend)
93{
94 //
95 // Wait for ready
96 //
98
99 //
100 // Send the character
101 //
103}
104
105/* EOF */
unsigned char BOOLEAN
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
#define UNIMPLEMENTED
Definition: debug.h:118
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
IN CINT OUT PVOID PortInformation
Definition: dumpinfo.c:40
#define HACK
Definition: kdserial.c:24
VOID NTAPI KdPortPutByteEx(IN PCPPORT PortInformation, IN UCHAR ByteToSend)
Definition: kdserial.c:91
BOOLEAN NTAPI KdPortInitializeEx(IN PCPPORT PortInformation, IN ULONG ComPortNumber)
Definition: kdserial.c:30
CPPORT DefaultPort
Definition: kdserial.c:18
BOOLEAN NTAPI KdPortGetByteEx(IN PCPPORT PortInformation, OUT PUCHAR ByteReceived)
Definition: kdserial.c:81
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define UART_PL011_LCRH_FEN
Definition: hwuart.c:28
#define UART_PL011_IBRD
Definition: hwuart.c:18
#define UART_PL01x_DR
Definition: hwuart.c:14
#define UART_PL011_CR_RXE
Definition: hwuart.c:35
#define UART_PL011_LCRH
Definition: hwuart.c:20
#define UART_PL011_LCRH_WLEN_8
Definition: hwuart.c:27
#define UART_PL011_CR_TXE
Definition: hwuart.c:34
#define UART_PL01x_FR_TXFF
Definition: hwuart.c:41
#define UART_PL011_FBRD
Definition: hwuart.c:19
#define UART_PL011_CR_UARTEN
Definition: hwuart.c:33
#define UART_PL01x_FR
Definition: hwuart.c:17
#define UART_PL011_CR
Definition: hwuart.c:21
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3045
unsigned char UCHAR
Definition: xmlstorage.h:181