https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a7d388c3508956cc1cb365...
commit a7d388c3508956cc1cb365ea955cda36a1bded81 Author: Colin Finck colin@reactos.org AuthorDate: Mon Oct 16 11:47:14 2017 +0200
[KD] [KD64] Introduce KdpPrintBanner and use it in all places where we print the (now consistent) banner instead of copying the code over and over again.
I still don't like that we're copying code between KD and KD64 instead of sharing it. But as both modules are totally distinct at the moment, I won't be the one introducing shared functions between them.
This is a follow up to 50ae5e7c5268222718174221366169e2b115b06a, which TortoiseGit accidentally turned into a "Message only" commit... Never hit ALT+Y by mistake! ;) --- ntoskrnl/kd/kdio.c | 39 +++++++++++++++------------------------ ntoskrnl/kd64/kdinit.c | 28 +++++++++++++++++----------- 2 files changed, 32 insertions(+), 35 deletions(-)
diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c index 40795de8bc..8dc3366f03 100644 --- a/ntoskrnl/kd/kdio.c +++ b/ntoskrnl/kd/kdio.c @@ -96,6 +96,18 @@ KdpGetMemorySizeInMBs(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return NumberOfPhysicalPages * PAGE_SIZE / 1024 / 1024; }
+/* See also: kd64\kdinit.c */ +static VOID +INIT_FUNCTION +KdpPrintBanner(IN SIZE_T MemSizeMBs) +{ + DPRINT1("-----------------------------------------------------\n"); + DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH ")\n"); + DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); + DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); + DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, KeLoaderBlock->NtHalPathName, KeLoaderBlock->ArcHalDeviceName, KeLoaderBlock->NtBootPathName); +} + /* FILE DEBUG LOG FUNCTIONS **************************************************/
VOID @@ -243,15 +255,8 @@ KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable, KeInitializeSpinLock(&KdpDebugLogSpinLock);
/* Display separator + ReactOS version at start of the debug log */ - DPRINT1("-----------------------------------------------------\n"); - DPRINT1("ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n"); MemSizeMBs = MmNumberOfPhysicalPages * PAGE_SIZE / 1024 / 1024; - DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); - DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); - DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, - KeLoaderBlock->NtHalPathName, - KeLoaderBlock->ArcHalDeviceName, - KeLoaderBlock->NtBootPathName); + KdpPrintBanner(MemSizeMBs); } else if (BootPhase == 2) { @@ -381,15 +386,8 @@ KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable, InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
/* Display separator + ReactOS version at start of the debug log */ - DPRINT1("-----------------------------------------------------\n"); - DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH "\n"); MemSizeMBs = KdpGetMemorySizeInMBs(KeLoaderBlock); - DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); - DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); - DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, - KeLoaderBlock->NtHalPathName, - KeLoaderBlock->ArcHalDeviceName, - KeLoaderBlock->NtBootPathName); + KdpPrintBanner(MemSizeMBs); } else if (BootPhase == 2) { @@ -556,15 +554,8 @@ KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable, KeInitializeSpinLock(&KdpDmesgLogSpinLock);
/* Display separator + ReactOS version at start of the debug log */ - DPRINT1("-----------------------------------------------------\n"); - DPRINT1("ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n"); MemSizeMBs = MmNumberOfPhysicalPages * PAGE_SIZE / 1024 / 1024; - DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); - DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); - DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, - KeLoaderBlock->NtHalPathName, - KeLoaderBlock->ArcHalDeviceName, - KeLoaderBlock->NtBootPathName); + KdpPrintBanner(MemSizeMBs); } else if (BootPhase == 2) { diff --git a/ntoskrnl/kd64/kdinit.c b/ntoskrnl/kd64/kdinit.c index 590e3b7aa0..64a7c7b519 100644 --- a/ntoskrnl/kd64/kdinit.c +++ b/ntoskrnl/kd64/kdinit.c @@ -65,6 +65,22 @@ KdpGetMemorySizeInMBs(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return NumberOfPhysicalPages * PAGE_SIZE / 1024 / 1024; }
+/* See also: kd\kdio.c */ +static VOID +INIT_FUNCTION +KdpPrintBanner(IN SIZE_T MemSizeMBs) +{ + DPRINT1("-----------------------------------------------------\n"); + DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH ")\n"); + DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); + + if (KeLoaderBlock) + { + DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); + DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, KeLoaderBlock->NtHalPathName, KeLoaderBlock->ArcHalDeviceName, KeLoaderBlock->NtBootPathName); + } +} + /* FUNCTIONS *****************************************************************/
VOID @@ -375,18 +391,8 @@ KdInitSystem(IN ULONG BootPhase, SharedUserData->KdDebuggerEnabled = TRUE;
/* Display separator + ReactOS version at start of the debug log */ - DPRINT1("-----------------------------------------------------\n"); - DPRINT1("ReactOS "KERNEL_VERSION_STR" (Build "KERNEL_VERSION_BUILD_STR")\n"); MemSizeMBs = KdpGetMemorySizeInMBs(KeLoaderBlock); - DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs); - if (KeLoaderBlock) - { - DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions); - DPRINT1("ARC Paths: %s %s %s %s\n", KeLoaderBlock->ArcBootDeviceName, - KeLoaderBlock->NtHalPathName, - KeLoaderBlock->ArcHalDeviceName, - KeLoaderBlock->NtBootPathName); - } + KdpPrintBanner(MemSizeMBs);
/* Check if the debugger should be disabled initially */ if (DisableKdAfterInit)