https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81b184741d9b32e8eff96…
commit 81b184741d9b32e8eff96bc93ee059938f4d853d
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Mon Mar 9 23:45:22 2020 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Mon Nov 16 08:55:03 2020 +0100
[NTOS:KD] Remove useless uses of _WINKD_
---
ntoskrnl/kd/kdmain.c | 5 +++++
ntoskrnl/kd64/kdapi.c | 7 +------
ntoskrnl/kd64/kdinit.c | 15 ---------------
ntoskrnl/kd64/kdlock.c | 4 ----
ntoskrnl/ntos.cmake | 38 +++++++++++---------------------------
5 files changed, 17 insertions(+), 52 deletions(-)
diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c
index 20b19911bc6..fb838d60124 100644
--- a/ntoskrnl/kd/kdmain.c
+++ b/ntoskrnl/kd/kdmain.c
@@ -188,6 +188,11 @@ KdDebuggerInitialize0(
/* Upcase it */
_strupr(CommandLine);
+#ifdef KDBG
+ /* Get the KDBG Settings */
+ KdbpGetCommandLineSettings(CommandLine);
+#endif
+
/* Get the port and baud rate */
Port = strstr(CommandLine, "DEBUGPORT");
BaudRate = strstr(CommandLine, "BAUDRATE");
diff --git a/ntoskrnl/kd64/kdapi.c b/ntoskrnl/kd64/kdapi.c
index df8876bc79a..847fd388fe0 100644
--- a/ntoskrnl/kd64/kdapi.c
+++ b/ntoskrnl/kd64/kdapi.c
@@ -123,8 +123,6 @@ KdpCopyMemoryChunks(
return RemainingLength == 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
}
-#ifdef _WINKD_
-
VOID
NTAPI
KdpQueryMemory(IN PDBGKD_MANIPULATE_STATE64 State,
@@ -1578,6 +1576,7 @@ SendPacket:
}
}
+#ifdef _WINKD_
VOID
NTAPI
KdpReportLoadSymbolsStateChange(IN PSTRING PathName,
@@ -1726,9 +1725,7 @@ KdpReportCommandStringStateChange(IN PSTRING NameString,
Context);
} while (Status == ContinueProcessorReselected);
}
-#endif
-#ifdef _WINKD_
BOOLEAN
NTAPI
KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
@@ -1858,7 +1855,6 @@ KdpSwitchProcessor(IN PEXCEPTION_RECORD ExceptionRecord,
return Status;
}
-#ifdef _WINKD_
LARGE_INTEGER
NTAPI
KdpQueryPerformanceCounter(IN PKTRAP_FRAME TrapFrame)
@@ -1875,7 +1871,6 @@ KdpQueryPerformanceCounter(IN PKTRAP_FRAME TrapFrame)
/* Otherwise, do the call */
return KeQueryPerformanceCounter(NULL);
}
-#endif
BOOLEAN
NTAPI
diff --git a/ntoskrnl/kd64/kdinit.c b/ntoskrnl/kd64/kdinit.c
index e3767d4f49f..6b8319605db 100644
--- a/ntoskrnl/kd64/kdinit.c
+++ b/ntoskrnl/kd64/kdinit.c
@@ -88,11 +88,9 @@ VOID
NTAPI
KdUpdateDataBlock(VOID)
{
-#ifdef _WINKD_
/* Update the KeUserCallbackDispatcher pointer */
KdDebuggerDataBlock.KeUserCallbackDispatcher =
(ULONG_PTR)KeUserCallbackDispatcher;
-#endif
}
BOOLEAN
@@ -250,7 +248,6 @@ KdInitSystem(IN ULONG BootPhase,
/* Enable KD */
EnableKd = TRUE;
-#ifdef _WINKD_
/* Check if there are any options */
if (DebugLine[5] == '=')
{
@@ -332,16 +329,6 @@ KdInitSystem(IN ULONG BootPhase,
DebugOptionStart = DebugOptionEnd;
}
}
-#else
- (VOID)DebugOptionStart;
- (VOID)DebugOptionEnd;
- (VOID)DebugOptionLength;
- KdDebuggerNotPresent = FALSE;
-#ifdef KDBG
- /* Get the KDBG Settings */
- KdbpGetCommandLineSettings(LoaderBlock->LoadOptions);
-#endif
-#endif
}
}
else
@@ -450,11 +437,9 @@ KdInitSystem(IN ULONG BootPhase,
/* Load symbols for image */
RtlInitString(&ImageName, NameBuffer);
-#ifdef _WINKD_
DbgLoadImageSymbols(&ImageName,
LdrEntry->DllBase,
(ULONG_PTR)PsGetCurrentProcessId());
-#endif
/* Go to the next entry */
NextEntry = NextEntry->Flink;
diff --git a/ntoskrnl/kd64/kdlock.c b/ntoskrnl/kd64/kdlock.c
index b75c4534aa0..25e4cde3dc9 100644
--- a/ntoskrnl/kd64/kdlock.c
+++ b/ntoskrnl/kd64/kdlock.c
@@ -74,7 +74,6 @@ BOOLEAN
NTAPI
KdPollBreakIn(VOID)
{
-#ifdef _WINKD_
BOOLEAN DoBreak = FALSE, Enable;
/* First make sure that KD is enabled */
@@ -119,7 +118,4 @@ KdPollBreakIn(VOID)
/* Tell the caller to do a break */
return DoBreak;
-#else
- return FALSE;
-#endif
}
diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake
index caeee0452b0..110dae4b3e6 100644
--- a/ntoskrnl/ntos.cmake
+++ b/ntoskrnl/ntos.cmake
@@ -164,6 +164,13 @@ list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/pnproot.c
${REACTOS_SOURCE_DIR}/ntoskrnl/io/pnpmgr/pnputil.c
${REACTOS_SOURCE_DIR}/ntoskrnl/io/debug.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdapi.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdbreak.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kddata.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdinit.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdlock.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdprint.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdtrap.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/apc.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/balmgr.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/bug.c
@@ -291,6 +298,7 @@ if(ARCH STREQUAL "i386")
${REACTOS_SOURCE_DIR}/ntoskrnl/rtl/i386/stack.S)
list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/config/i386/cmhardwr.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/i386/kdx86.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/abios.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/cpu.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/context.c
@@ -318,6 +326,7 @@ elseif(ARCH STREQUAL "amd64")
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/usercall_asm.S)
list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/config/i386/cmhardwr.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/amd64/kdx64.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/context.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/cpu.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/except.c
@@ -342,6 +351,7 @@ elseif(ARCH STREQUAL "arm")
list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/config/arm/cmhardwr.c
${REACTOS_SOURCE_DIR}/ntoskrnl/kd/arm/kdbg.c
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/arm/kdarm.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/cpu.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/exp.c
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/interrupt.c
@@ -397,32 +407,6 @@ if(NOT _WINKD_)
${REACTOS_SOURCE_DIR}/ntoskrnl/kd/wrappers/bochs.c
${REACTOS_SOURCE_DIR}/ntoskrnl/kd/wrappers/kdbg.c
${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdio.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdmain.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdapi.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdbreak.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kddata.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdinit.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdlock.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdprint.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdtrap.c)
-
-else() # _WINKD_
-
- list(APPEND SOURCE
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdapi.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdbreak.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kddata.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdinit.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdlock.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdprint.c
- ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/kdtrap.c)
-
- if(ARCH STREQUAL "i386")
- list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/i386/kdx86.c)
- elseif(ARCH STREQUAL "amd64")
- list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/amd64/kdx64.c)
- elseif(ARCH STREQUAL "arm")
- list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/arm/kdarm.c)
- endif()
+ ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/kdmain.c)
endif()