Author: ion
Date: Sun Feb 18 19:50:37 2007
New Revision: 25835
URL:
http://svn.reactos.org/svn/reactos?rev=25835&view=rev
Log:
- Add stubs for KdSave, KdRestore, KdDebuggerInitialize0, KdSendPacket, KdReceivePacket to
kdcom.dll
- Implement and export KeTryToAcquireSpinLockAtDpcLevel.
Modified:
branches/alex-kd-branch/reactos/drivers/base/kdcom/kdbg.c
branches/alex-kd-branch/reactos/drivers/base/kdcom/kdcom.def
branches/alex-kd-branch/reactos/ntoskrnl/ke/spinlock.c
branches/alex-kd-branch/reactos/ntoskrnl/ntoskrnl.def
Modified: branches/alex-kd-branch/reactos/drivers/base/kdcom/kdbg.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/drivers/…
==============================================================================
--- branches/alex-kd-branch/reactos/drivers/base/kdcom/kdbg.c (original)
+++ branches/alex-kd-branch/reactos/drivers/base/kdcom/kdbg.c Sun Feb 18 19:50:37 2007
@@ -17,6 +17,8 @@
#include <halfuncs.h>
#include <stdio.h>
#include <debug.h>
+#include "arc/arc.h"
+#include "windbgkd.h"
typedef struct _KD_PORT_INFORMATION
{
@@ -553,4 +555,66 @@
return TRUE;
}
+/*
+ * @unimplemented
+ */
+NTSTATUS
+NTAPI
+KdDebuggerInitialize0(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL)
+{
+ /* FIXME: TODO */
+ return STATUS_UNSUCCESSFUL;
+}
+
+/*
+ * @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 USHORT PacketType,
+ IN PSTRING Header,
+ IN PSTRING Data OPTIONAL,
+ OUT PKD_CONTEXT Context)
+{
+ /* FIXME: TODO */
+ return;
+}
+
+/*
+ * @unimplemented
+ */
+ULONG
+NTAPI
+KdReceivePacket(IN USHORT PacketType,
+ OUT PSTRING Header,
+ OUT PSTRING Data,
+ OUT PUSHORT DataSize,
+ OUT PKD_CONTEXT Context OPTIONAL)
+{
+ /* FIXME: TODO */
+ return 0;
+}
+
/* EOF */
Modified: branches/alex-kd-branch/reactos/drivers/base/kdcom/kdcom.def
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/drivers/…
==============================================================================
--- branches/alex-kd-branch/reactos/drivers/base/kdcom/kdcom.def (original)
+++ branches/alex-kd-branch/reactos/drivers/base/kdcom/kdcom.def Sun Feb 18 19:50:37 2007
@@ -1,15 +1,8 @@
LIBRARY kdcom.dll
EXPORTS
-KdPortGetByte@4
-KdPortGetByteEx@8
-KdPortInitialize@12
-KdPortInitializeEx@12
-KdPortPollByte@4
-KdPortPollByteEx@8
-KdPortPutByte@4
-KdPortPutByteEx@8
-KdPortRestore@0
-KdPortSave@0
-KdPortDisableInterrupts@0
-KdPortEnableInterrupts@0
+KdDebuggerInitialize0@4
+KdSave@4
+KdRestore@4
+KdReceivePacket@20
+KdSendPacket@16
Modified: branches/alex-kd-branch/reactos/ntoskrnl/ke/spinlock.c
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/ke/spinlock.c (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/ke/spinlock.c Sun Feb 18 19:50:37 2007
@@ -168,6 +168,40 @@
/*
* @implemented
*/
+BOOLEAN
+FASTCALL
+KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
+{
+#ifdef CONFIG_SMP
+ /* Check if it's already acquired */
+ if (!(*SpinLock))
+ {
+ /* Try to acquire it */
+ if (InterlockedBitTestAndSet((PLONG)SpinLock, 0))
+ {
+ /* Someone else acquired it */
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* It was already acquired */
+ return FALSE;
+ }
+
+#ifdef DBG
+ /* On debug builds, we OR in the KTHREAD */
+ *SpinLock = (ULONG_PTR)KeGetCurrentThread() | 1;
+#endif
+#endif
+
+ /* All is well, return TRUE */
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
VOID
FASTCALL
KeAcquireInStackQueuedSpinLockAtDpcLevel(IN PKSPIN_LOCK SpinLock,
Modified: branches/alex-kd-branch/reactos/ntoskrnl/ntoskrnl.def
URL:
http://svn.reactos.org/svn/reactos/branches/alex-kd-branch/reactos/ntoskrnl…
==============================================================================
--- branches/alex-kd-branch/reactos/ntoskrnl/ntoskrnl.def (original)
+++ branches/alex-kd-branch/reactos/ntoskrnl/ntoskrnl.def Sun Feb 18 19:50:37 2007
@@ -650,6 +650,7 @@
KeTerminateThread@4
KeTickCount DATA
@KeTryToAcquireGuardedMutex@4
+@KeTryToAcquireSpinLockAtDpcLevel@4
KeUpdateRunTime@4
KeUpdateSystemTime@0
KeUnstackDetachProcess@4