Hervé Poussineau <poussine(a)freesurf.fr>
Solve quarrel between GDB stub and serenum
Modified: trunk/reactos/ntoskrnl/io/pnpreport.c
_____
Modified: trunk/reactos/ntoskrnl/io/pnpreport.c
--- trunk/reactos/ntoskrnl/io/pnpreport.c 2005-04-19 21:47:05 UTC
(rev 14706)
+++ trunk/reactos/ntoskrnl/io/pnpreport.c 2005-04-19 22:33:09 UTC
(rev 14707)
@@ -1,4 +1,4 @@
-/* $Id:$
+/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -116,7 +116,37 @@
}
}
}
-
+
+ if ((KdDebugState & KD_DEBUG_GDB) && DriverList != NULL)
+ {
+ ULONG ComPortBase = 0;
+ ULONG i;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor;
+
+ switch (GdbPortInfo.ComPort)
+ {
+ case 1: ComPortBase = 0x3f8; break;
+ case 2: ComPortBase = 0x2f8; break;
+ case 3: ComPortBase = 0x3e8; break;
+ case 4: ComPortBase = 0x2e8; break;
+ }
+
+ /* search for this port address in DriverList */
+ for (i = 0; i < DriverList->List[0].PartialResourceList.Count; i++)
+ {
+ ResourceDescriptor =
&DriverList->List[0].PartialResourceList.PartialDescriptors[i];
+ if (ResourceDescriptor->Type == CmResourceTypePort)
+ {
+ if (ResourceDescriptor->u.Port.Start.u.LowPart <= ComPortBase
+ && ResourceDescriptor->u.Port.Start.u.LowPart +
ResourceDescriptor->u.Port.Length > ComPortBase)
+ {
+ *ConflictDetected = TRUE;
+ return STATUS_CONFLICTING_ADDRESSES;
+ }
+ }
+ }
+ }
+
if (PopSystemPowerDeviceNode != NULL && DriverListSize > 0)
{
/* We hope legacy devices will be enumerated by ACPI */
Show replies by date