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

Go to the source code of this file.

Macros

#define NDEBUG
 
#define HACK   24000000
 

Functions

NTSTATUS NTAPI KdDebuggerInitialize1 (IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
 
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 kdbg.c.

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file kdbg.c.

Function Documentation

◆ KdDebuggerInitialize1()

NTSTATUS NTAPI KdDebuggerInitialize1 ( IN PLOADER_PARAMETER_BLOCK LoaderBlock  OPTIONAL)

Definition at line 30 of file kdbg.c.

31 {
33 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

◆ KdPortGetByteEx()

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

Definition at line 88 of file kdbg.c.

90 {
92  while (TRUE);
93  return FALSE;
94 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED
Definition: debug.h:115

◆ KdPortInitializeEx()

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

Definition at line 37 of file kdbg.c.

39 {
40  ULONG Divider, Remainder, Fraction;
41  ULONG Baudrate = PortInformation->BaudRate;
42 
43  //
44  // Calculate baudrate clock divider and remainder
45  //
46  Divider = HACK / (16 * Baudrate);
47  Remainder = HACK % (16 * Baudrate);
48 
49  //
50  // Calculate the fractional part
51  //
52  Fraction = (8 * Remainder / Baudrate) >> 1;
53  Fraction += (8 * Remainder / Baudrate) & 1;
54 
55  //
56  // Disable interrupts
57  //
59 
60  //
61  // Set the baud rate
62  //
65 
66  //
67  // Set 8 bits for data, 1 stop bit, no parity, FIFO enabled
68  //
71 
72  //
73  // Clear and enable FIFO
74  //
79 
80  //
81  // Done
82  //
83  return TRUE;
84 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
#define TRUE
Definition: types.h:120
#define UART_PL011_LCRH_WLEN_8
Definition: hwuart.c:27
#define UART_PL011_CR_UARTEN
Definition: hwuart.c:33
IN CINT OUT PVOID PortInformation
Definition: dumpinfo.c:39
#define UART_PL011_CR
Definition: hwuart.c:21
#define UART_PL011_CR_TXE
Definition: hwuart.c:34
#define HACK
Definition: kdbg.c:24
#define UART_PL011_LCRH_FEN
Definition: hwuart.c:28
#define UART_PL011_IBRD
Definition: hwuart.c:18
unsigned int * PULONG
Definition: retypes.h:1
#define UART_PL011_FBRD
Definition: hwuart.c:19
#define UART_PL011_LCRH
Definition: hwuart.c:20
unsigned int ULONG
Definition: retypes.h:1
#define UART_PL011_CR_RXE
Definition: hwuart.c:35
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3046

◆ KdPortPutByteEx()

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

Definition at line 98 of file kdbg.c.

100 {
101  //
102  // Wait for ready
103  //
105 
106  //
107  // Send the character
108  //
110 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
#define UART_PL01x_DR
Definition: hwuart.c:14
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
#define UART_PL01x_FR
Definition: hwuart.c:17
unsigned int * PULONG
Definition: retypes.h:1
#define UART_PL01x_FR_TXFF
Definition: hwuart.c:41

Variable Documentation

◆ DefaultPort

CPPORT DefaultPort = {0, 0, 0}

Definition at line 18 of file kdbg.c.

Referenced by KdPortInitializeEx().