https://git.reactos.org/?p=reactos.git;a=commitdiff;h=968b264300e25dbf3efa9…
commit 968b264300e25dbf3efa978682b4655d105718bd
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Nov 24 01:44:03 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Nov 24 01:44:14 2022 +0100
[NTOS:KD] Rename the private acquire/release lock functions to fix GCC compilation.
If you ask why there are two sets of functions that do the same, it's
because this file (and the kdmain.c) will very soon some day be moved to
a transport dll, outside the kernel, and it will need these functions.
---
ntoskrnl/kd/kdio.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/ntoskrnl/kd/kdio.c b/ntoskrnl/kd/kdio.c
index 8c0ca1825ad..3f39e20c173 100644
--- a/ntoskrnl/kd/kdio.c
+++ b/ntoskrnl/kd/kdio.c
@@ -69,7 +69,8 @@ static NTSTATUS KdbgContinueStatus = STATUS_SUCCESS;
KIRQL
NTAPI
-KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
+KdbpAcquireLock(
+ _In_ PKSPIN_LOCK SpinLock)
{
KIRQL OldIrql;
@@ -95,8 +96,9 @@ KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
VOID
NTAPI
-KdpReleaseLock(IN PKSPIN_LOCK SpinLock,
- IN KIRQL OldIrql)
+KdbpReleaseLock(
+ _In_ PKSPIN_LOCK SpinLock,
+ _In_ KIRQL OldIrql)
{
/* Release the spinlock */
KiReleaseSpinLock(SpinLock);
@@ -169,7 +171,7 @@ KdpPrintToLogFile(PCHAR String,
if (KdpDebugBuffer == NULL) return;
/* Acquire the printing spinlock without waiting at raised IRQL */
- OldIrql = KdpAcquireLock(&KdpDebugLogSpinLock);
+ OldIrql = KdbpAcquireLock(&KdpDebugLogSpinLock);
beg = KdpCurrentPosition;
num = KdpFreeBytes;
@@ -198,7 +200,7 @@ KdpPrintToLogFile(PCHAR String,
{
DoReinit = TRUE;
}
- KdpReleaseLock(&KdpDebugLogSpinLock, OldIrql);
+ KdbpReleaseLock(&KdpDebugLogSpinLock, OldIrql);
if (DoReinit)
{
@@ -322,7 +324,7 @@ KdpSerialPrint(PCHAR String,
KIRQL OldIrql;
/* Acquire the printing spinlock without waiting at raised IRQL */
- OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
+ OldIrql = KdbpAcquireLock(&KdpSerialSpinLock);
/* Output the string */
while (pch < String + Length && *pch)
@@ -336,7 +338,7 @@ KdpSerialPrint(PCHAR String,
}
/* Release the spinlock */
- KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
+ KdbpReleaseLock(&KdpSerialSpinLock, OldIrql);
}
VOID
@@ -471,7 +473,7 @@ KdpScreenPrint(PCHAR String,
return;
/* Acquire the printing spinlock without waiting at raised IRQL */
- OldIrql = KdpAcquireLock(&KdpDmesgLogSpinLock);
+ OldIrql = KdbpAcquireLock(&KdpDmesgLogSpinLock);
/* Invariant: always_true(KdpDmesgFreeBytes == KdpDmesgBufferSize);
* set num to min(KdpDmesgFreeBytes, Length).
@@ -497,7 +499,7 @@ KdpScreenPrint(PCHAR String,
}
/* Release the spinlock */
- KdpReleaseLock(&KdpDmesgLogSpinLock, OldIrql);
+ KdbpReleaseLock(&KdpDmesgLogSpinLock, OldIrql);
/* Optional step(?): find out a way to notify about buffer exhaustion,
* and possibly fall into kbd to use dmesg command: user will read
@@ -738,7 +740,7 @@ KdReceivePacket(
// TODO: Use an improved KdbpReadCommand() function for our purposes.
/* Acquire the printing spinlock without waiting at raised IRQL */
- OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
+ OldIrql = KdbpAcquireLock(&KdpSerialSpinLock);
if (!(KdbDebugState & KD_DEBUG_KDSERIAL))
KbdDisableMouse();
@@ -795,13 +797,13 @@ KdReceivePacket(
/* Write it back and print it to the log */
*(PCHAR)(ResponseString.Buffer + i) = Response;
- KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
+ KdbpReleaseLock(&KdpSerialSpinLock, OldIrql);
KdpPrintString(&StringChar);
- OldIrql = KdpAcquireLock(&KdpSerialSpinLock);
+ OldIrql = KdbpAcquireLock(&KdpSerialSpinLock);
}
/* Release the spinlock */
- KdpReleaseLock(&KdpSerialSpinLock, OldIrql);
+ KdbpReleaseLock(&KdpSerialSpinLock, OldIrql);
/* Print a new line */
*StringChar.Buffer = '\n';