https://git.reactos.org/?p=reactos.git;a=commitdiff;h=579eab8a31951b0fef566…
commit 579eab8a31951b0fef56624c62066d38af12dd63
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Apr 4 23:38:32 2023 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Apr 11 00:44:10 2023 +0200
[NTOS] Include kdbg/kdb.h only in the files that really need it.
---
ntoskrnl/cc/view.c | 6 +++++-
ntoskrnl/ex/handle.c | 6 +++++-
ntoskrnl/include/internal/ntoskrnl.h | 3 ---
ntoskrnl/kd/kdio.c | 3 +++
ntoskrnl/kd64/kdapi.c | 9 +++++++--
ntoskrnl/kdbg/i386/i386-dis.c | 2 ++
ntoskrnl/kdbg/kdb.c | 2 ++
ntoskrnl/kdbg/kdb_cli.c | 1 +
ntoskrnl/kdbg/kdb_expr.c | 2 ++
ntoskrnl/kdbg/kdb_symbols.c | 1 +
ntoskrnl/ke/bug.c | 4 ++++
ntoskrnl/mm/ARM3/expool.c | 4 ++++
ntoskrnl/mm/ARM3/kdbg.c | 4 +++-
13 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 97d675c2b04..a40272f8f34 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -1388,6 +1388,9 @@ CcInitView (
}
#if DBG && defined(KDBG)
+
+#include <kdbg/kdb.h>
+
BOOLEAN
ExpKdbgExtFileCache(ULONG Argc, PCHAR Argv[])
{
@@ -1478,6 +1481,7 @@ ExpKdbgExtDefWrites(ULONG Argc, PCHAR Argv[])
return TRUE;
}
-#endif
+
+#endif // DBG && defined(KDBG)
/* EOF */
diff --git a/ntoskrnl/ex/handle.c b/ntoskrnl/ex/handle.c
index e932ca2efbd..b844635b34f 100644
--- a/ntoskrnl/ex/handle.c
+++ b/ntoskrnl/ex/handle.c
@@ -1320,6 +1320,9 @@ ExEnumHandleTable(IN PHANDLE_TABLE HandleTable,
}
#if DBG && defined(KDBG)
+
+#include <kdbg/kdb.h>
+
BOOLEAN ExpKdbgExtHandle(ULONG Argc, PCHAR Argv[])
{
USHORT i;
@@ -1495,4 +1498,5 @@ BOOLEAN ExpKdbgExtHandle(ULONG Argc, PCHAR Argv[])
return TRUE;
}
-#endif
+
+#endif // DBG && defined(KDBG)
diff --git a/ntoskrnl/include/internal/ntoskrnl.h b/ntoskrnl/include/internal/ntoskrnl.h
index a49bfb9b57e..5bb1b90f652 100644
--- a/ntoskrnl/include/internal/ntoskrnl.h
+++ b/ntoskrnl/include/internal/ntoskrnl.h
@@ -68,9 +68,6 @@
#include "fsrtl.h"
#include "lpc.h"
#include "rtl.h"
-#ifdef KDBG
-#include <kdbg/kdb.h>
-#endif
#include "dbgk.h"
#include "spinlock.h"
#include "test.h"
diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c
index a196b905113..3e94c1f0ac6 100644
--- a/ntoskrnl/kd/kdio.c
+++ b/ntoskrnl/kd/kdio.c
@@ -13,6 +13,9 @@
#include <reactos/buildno.h>
#include "kd.h"
#include "kdterminal.h"
+#ifdef KDBG
+#include "../kdbg/kdb.h"
+#endif
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/kd64/kdapi.c b/ntoskrnl/kd64/kdapi.c
index e91d76d982e..3295d3b256c 100644
--- a/ntoskrnl/kd64/kdapi.c
+++ b/ntoskrnl/kd64/kdapi.c
@@ -10,6 +10,11 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
+
+#ifdef KDBG
+#include <kdbg/kdb.h>
+#endif
+
#define NDEBUG
#include <debug.h>
@@ -2209,13 +2214,13 @@ KdSystemDebugControl(
KeRosDumpStackFrames((PULONG_PTR)InputBuffer, InputBufferLength);
break;
}
-#if defined(KDBG)
+#ifdef KDBG
/* Register KDBG CLI callback */
case 'RbdK':
{
return KdbRegisterCliCallback(InputBuffer, InputBufferLength);
}
-#endif /* KDBG */
+#endif // KDBG
#endif
default:
break;
diff --git a/ntoskrnl/kdbg/i386/i386-dis.c b/ntoskrnl/kdbg/i386/i386-dis.c
index c60470aa436..86b2e9dac9a 100644
--- a/ntoskrnl/kdbg/i386/i386-dis.c
+++ b/ntoskrnl/kdbg/i386/i386-dis.c
@@ -8,6 +8,8 @@
*/
#include <ntoskrnl.h>
+#include "../kdb.h"
+
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/kdbg/kdb.c b/ntoskrnl/kdbg/kdb.c
index 8fd5b6675d8..3c663cbddbc 100644
--- a/ntoskrnl/kdbg/kdb.c
+++ b/ntoskrnl/kdbg/kdb.c
@@ -10,6 +10,8 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
+#include "kdb.h"
+
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c
index f889bd850a7..4dde1487a08 100644
--- a/ntoskrnl/kdbg/kdb_cli.c
+++ b/ntoskrnl/kdbg/kdb_cli.c
@@ -29,6 +29,7 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
+#include "kdb.h"
#include "../kd/kdterminal.h"
#define NDEBUG
diff --git a/ntoskrnl/kdbg/kdb_expr.c b/ntoskrnl/kdbg/kdb_expr.c
index 73bff96cde1..f868d6df376 100644
--- a/ntoskrnl/kdbg/kdb_expr.c
+++ b/ntoskrnl/kdbg/kdb_expr.c
@@ -34,6 +34,8 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
+#include "kdb.h"
+
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/kdbg/kdb_symbols.c b/ntoskrnl/kdbg/kdb_symbols.c
index 69861f23ed8..b8491fefa4b 100644
--- a/ntoskrnl/kdbg/kdb_symbols.c
+++ b/ntoskrnl/kdbg/kdb_symbols.c
@@ -11,6 +11,7 @@
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
+#include "kdb.h"
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c
index 16862193986..2eea78d0fba 100644
--- a/ntoskrnl/ke/bug.c
+++ b/ntoskrnl/ke/bug.c
@@ -10,6 +10,10 @@
#include <ntoskrnl.h>
+#ifdef KDBG
+#include <kdbg/kdb.h>
+#endif
+
#define NDEBUG
#include <debug.h>
diff --git a/ntoskrnl/mm/ARM3/expool.c b/ntoskrnl/mm/ARM3/expool.c
index 74393137162..3e5630bd1ac 100644
--- a/ntoskrnl/mm/ARM3/expool.c
+++ b/ntoskrnl/mm/ARM3/expool.c
@@ -479,6 +479,10 @@ ExpComputePartialHashForAddress(IN PVOID BaseAddress)
#define ExpTagAllowPrint(Tag) \
((Tag) >= 0x20 /* Space */ && (Tag) <= 0x7E /* Tilde */)
+#ifdef KDBG
+#include <kdbg/kdb.h>
+#endif
+
#ifdef KDBG
#define MiDumperPrint(dbg, fmt, ...) \
if (dbg) KdbpPrint(fmt, ##__VA_ARGS__); \
diff --git a/ntoskrnl/mm/ARM3/kdbg.c b/ntoskrnl/mm/ARM3/kdbg.c
index d568c42b45f..141beadc43f 100644
--- a/ntoskrnl/mm/ARM3/kdbg.c
+++ b/ntoskrnl/mm/ARM3/kdbg.c
@@ -44,6 +44,8 @@ VOID MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask,
ULONG Fla
#if DBG && defined(KDBG)
+#include <kdbg/kdb.h>
+
BOOLEAN
ExpKdbgExtPool(
ULONG Argc,
@@ -620,6 +622,6 @@ ExpKdbgExtIrpFind(
return TRUE;
}
-#endif // DBG && KDBG
+#endif // DBG && defined(KDBG)
/* EOF */