From a23361e756b0e5bb553ac025b461bc0d74b1f525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 5 May 2013 21:57:42 +0000 Subject: [PATCH] [KDROSDBG] Place the (unimplemented) real KD functions into a dedicated file and isolate ReactOS-specific port functions. They can go into a libary along KDBG ! svn path=/branches/kd++/; revision=58958 --- drivers/base/kdrosdbg/CMakeLists.txt | 1 + drivers/base/kdrosdbg/arm/kdbg.c | 84 ++----------------- drivers/base/kdrosdbg/i386/kdbg.c | 101 +---------------------- drivers/base/kdrosdbg/kdrosdbg.c | 116 +++++++++++++++++++++++++++ 4 files changed, 125 insertions(+), 177 deletions(-) create mode 100644 drivers/base/kdrosdbg/kdrosdbg.c diff --git a/drivers/base/kdrosdbg/CMakeLists.txt b/drivers/base/kdrosdbg/CMakeLists.txt index 4f6e8f29249..0b1746abfde 100644 --- a/drivers/base/kdrosdbg/CMakeLists.txt +++ b/drivers/base/kdrosdbg/CMakeLists.txt @@ -9,6 +9,7 @@ elseif(ARCH STREQUAL "arm") list(APPEND SOURCE arm/kdbg.c) endif(ARCH STREQUAL "i386") list(APPEND SOURCE + kdrosdbg.c kdrosdbg.rc ${CMAKE_CURRENT_BINARY_DIR}/kdcom.def) diff --git a/drivers/base/kdrosdbg/arm/kdbg.c b/drivers/base/kdrosdbg/arm/kdbg.c index 38404e3c5ef..1ef30ea8fd4 100644 --- a/drivers/base/kdrosdbg/arm/kdbg.c +++ b/drivers/base/kdrosdbg/arm/kdbg.c @@ -10,16 +10,17 @@ #define NOEXTAPI #include -#define NDEBUG #include #include -#include -#include "arc/arc.h" -#include "windbgkd.h" +#include +#include #include #include #include +#define NDEBUG +#include + /* GLOBALS ********************************************************************/ typedef struct _KD_PORT_INFORMATION @@ -117,79 +118,4 @@ KdPortPutByteEx(IN PKD_PORT_INFORMATION PortInformation, WRITE_REGISTER_ULONG(UART_PL01x_DR, ByteToSend); } -/* WINDOWS FUNCTIONS **********************************************************/ - -NTSTATUS -NTAPI -KdDebuggerInitialize0(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -NTAPI -KdDebuggerInitialize1(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -NTAPI -KdD0Transition(VOID) -{ - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -KdD3Transition(VOID) -{ - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -KdSave(IN BOOLEAN SleepTransition) -{ - UNIMPLEMENTED; - while (TRUE); - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -KdRestore(IN BOOLEAN SleepTransition) -{ - UNIMPLEMENTED; - while (TRUE); - return STATUS_SUCCESS; -} - -VOID -NTAPI -KdSendPacket(IN ULONG PacketType, - IN PSTRING MessageHeader, - IN PSTRING MessageData, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - while (TRUE); - return; -} - -KDSTATUS -NTAPI -KdReceivePacket(IN ULONG PacketType, - OUT PSTRING MessageHeader, - OUT PSTRING MessageData, - OUT PULONG DataLength, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - while (TRUE); - return 0; -} - /* EOF */ diff --git a/drivers/base/kdrosdbg/i386/kdbg.c b/drivers/base/kdrosdbg/i386/kdbg.c index 2fab855fdde..8490d08aed0 100644 --- a/drivers/base/kdrosdbg/i386/kdbg.c +++ b/drivers/base/kdrosdbg/i386/kdbg.c @@ -13,8 +13,8 @@ #include #include #include -#include "arc/arc.h" -#include "windbgkd.h" +#include +#include #include #include /* port intrinsics */ #include @@ -98,9 +98,8 @@ const ULONG BaseArray[] = {0, 0xF1012000}; // static BOOLEAN PortInitialized = FALSE; -/* FUNCTIONS ****************************************************************/ +/* REACTOS FUNCTIONS **********************************************************/ -/* ReactOS-specific */ BOOLEAN NTAPI KdPortInitializeEx( @@ -229,8 +228,6 @@ KdPortInitializeEx( return TRUE; } - -/* ReactOS-specific */ BOOLEAN NTAPI KdPortGetByteEx( @@ -248,7 +245,6 @@ KdPortGetByteEx( return FALSE; } -/* ReactOS-specific */ VOID NTAPI KdPortPutByteEx( @@ -263,95 +259,4 @@ KdPortPutByteEx( WRITE_PORT_UCHAR(SER_THR(ComPortBase), ByteToSend); } -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KdDebuggerInitialize0( - IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - return STATUS_NOT_IMPLEMENTED; -} - -/* - * @unimplemented - */ -NTSTATUS -NTAPI -KdDebuggerInitialize1( - IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) -{ - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS -NTAPI -KdD0Transition(VOID) -{ - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -KdD3Transition(VOID) -{ - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KdSave( - IN BOOLEAN SleepTransition) -{ - /* Nothing to do on COM ports */ - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -KdRestore( - IN BOOLEAN SleepTransition) -{ - /* Nothing to do on COM ports */ - return STATUS_SUCCESS; -} - -/* - * @unimplemented - */ -VOID -NTAPI -KdSendPacket( - IN ULONG PacketType, - IN PSTRING MessageHeader, - IN PSTRING MessageData, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - return; -} - -/* - * @unimplemented - */ -KDSTATUS -NTAPI -KdReceivePacket( - IN ULONG PacketType, - OUT PSTRING MessageHeader, - OUT PSTRING MessageData, - OUT PULONG DataLength, - IN OUT PKD_CONTEXT Context) -{ - UNIMPLEMENTED; - return 0; -} - /* EOF */ diff --git a/drivers/base/kdrosdbg/kdrosdbg.c b/drivers/base/kdrosdbg/kdrosdbg.c new file mode 100644 index 00000000000..e8cccf93cc1 --- /dev/null +++ b/drivers/base/kdrosdbg/kdrosdbg.c @@ -0,0 +1,116 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/base/kdcom/kdbg.c + * PURPOSE: Serial i/o functions for the kernel debugger. + * PROGRAMMER: Alex Ionescu + * Hervé Poussineau + */ + +/* INCLUDES *****************************************************************/ + +#define NOEXTAPI +#include +#include +#include +#include +#include +#include + +#define NDEBUG +#include + +/* FUNCTIONS ****************************************************************/ + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KdDebuggerInitialize0( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + return STATUS_NOT_IMPLEMENTED; +} + +/* + * @unimplemented + */ +NTSTATUS +NTAPI +KdDebuggerInitialize1( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +NTAPI +KdD0Transition(VOID) +{ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +KdD3Transition(VOID) +{ + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KdSave( + IN BOOLEAN SleepTransition) +{ + /* Nothing to do on COM ports */ + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI +KdRestore( + IN BOOLEAN SleepTransition) +{ + /* Nothing to do on COM ports */ + return STATUS_SUCCESS; +} + +/* + * @unimplemented + */ +VOID +NTAPI +KdSendPacket( + IN ULONG PacketType, + IN PSTRING MessageHeader, + IN PSTRING MessageData, + IN OUT PKD_CONTEXT Context) +{ + UNIMPLEMENTED; + return; +} + +/* + * @unimplemented + */ +KDSTATUS +NTAPI +KdReceivePacket( + IN ULONG PacketType, + OUT PSTRING MessageHeader, + OUT PSTRING MessageData, + OUT PULONG DataLength, + IN OUT PKD_CONTEXT Context) +{ + UNIMPLEMENTED; + return 0; +} + +/* EOF */