From 9da5e3306e7689523d07c23e4a8ee76682a6b9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Tue, 19 Apr 2005 22:33:09 +0000 Subject: [PATCH] =?UTF-8?q?Herv=C3=A9=20Poussineau=20=20Solve=20quarrel=20between=20GDB=20stub=20and=20serenum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=14707 --- reactos/ntoskrnl/io/pnpreport.c | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/io/pnpreport.c b/reactos/ntoskrnl/io/pnpreport.c index 0da03bd153c..18407ef6dfb 100644 --- a/reactos/ntoskrnl/io/pnpreport.c +++ b/reactos/ntoskrnl/io/pnpreport.c @@ -1,4 +1,4 @@ -/* $Id:$ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -116,7 +116,37 @@ IoReportResourceForDetection( } } } - + + 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 */