ReactOS 0.4.15-dev-7942-gd23573b
kdserial.c File Reference
#include <ntoskrnl.h>
#include <arm/peripherals/pl011.h>
#include <debug.h>
Include dependency graph for kdserial.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define HACK   24000000
 

Functions

BOOLEAN NTAPI KdPortInitializeEx (IN PCPPORT PortInformation, IN ULONG ComPortNumber)
 
BOOLEAN NTAPI KdPortGetByteEx (IN PCPPORT PortInformation, OUT PUCHAR ByteReceived)
 
VOID NTAPI KdPortPutByteEx (IN PCPPORT PortInformation, IN UCHAR ByteToSend)
 

Variables

CPPORT DefaultPort = {0, 0, 0}
 

Macro Definition Documentation

◆ HACK

#define HACK   24000000

Definition at line 24 of file kdserial.c.

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file kdserial.c.

Function Documentation

◆ KdPortGetByteEx()

BOOLEAN NTAPI KdPortGetByteEx ( IN PCPPORT  PortInformation,
OUT PUCHAR  ByteReceived 
)

Definition at line 81 of file kdserial.c.

83{
85 while (TRUE);
86 return FALSE;
87}
#define UNIMPLEMENTED
Definition: debug.h:115
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by KdbpTryGetCharSerial().

◆ KdPortInitializeEx()

BOOLEAN NTAPI KdPortInitializeEx ( IN PCPPORT  PortInformation,
IN ULONG  ComPortNumber 
)

Definition at line 30 of file kdserial.c.

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}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
IN CINT OUT PVOID PortInformation
Definition: dumpinfo.c:40
#define HACK
Definition: kdserial.c:24
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
#define UART_PL011_LCRH_FEN
Definition: hwuart.c:28
#define UART_PL011_IBRD
Definition: hwuart.c:18
#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_PL011_FBRD
Definition: hwuart.c:19
#define UART_PL011_CR_UARTEN
Definition: hwuart.c:33
#define UART_PL011_CR
Definition: hwuart.c:21
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3045

◆ KdPortPutByteEx()

VOID NTAPI KdPortPutByteEx ( IN PCPPORT  PortInformation,
IN UCHAR  ByteToSend 
)

Definition at line 91 of file kdserial.c.

93{
94 //
95 // Wait for ready
96 //
98
99 //
100 // Send the character
101 //
103}
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
#define UART_PL01x_DR
Definition: hwuart.c:14
#define UART_PL01x_FR_TXFF
Definition: hwuart.c:41
#define UART_PL01x_FR
Definition: hwuart.c:17

Referenced by KdbpSendCommandSerial().

Variable Documentation

◆ DefaultPort

CPPORT DefaultPort = {0, 0, 0}

Definition at line 18 of file kdserial.c.

Referenced by KdPortInitializeEx().