mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[ACPI] Properly return a single alternative in Bus_PDO_QueryResourceRequirements. CORE-12892 CORE-14688
In ACPI resource descriptors, alternatives are marked with StartDependent tags. Only the last set is terminated with EndDependent. Therefore, since we only return the first alternative list for now, ignore the first StartDependent tag and terminate enumeration at the second. In the future we will need to build the full set of alternative lists here, which will also make the unit test succeed fully. This should fix random resource conflicts and make COM ports usable.
This commit is contained in:
parent
28be285da5
commit
152265729b
1 changed files with 22 additions and 3 deletions
|
@ -1310,6 +1310,7 @@ Bus_PDO_QueryResourceRequirements(
|
|||
PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
|
||||
PIO_RESOURCE_DESCRIPTOR RequirementDescriptor;
|
||||
BOOLEAN CurrentRes = FALSE;
|
||||
BOOLEAN SeenStartDependent;
|
||||
|
||||
PAGED_CODE ();
|
||||
|
||||
|
@ -1360,10 +1361,19 @@ Bus_PDO_QueryResourceRequirements(
|
|||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
resource= Buffer.Pointer;
|
||||
SeenStartDependent = FALSE;
|
||||
resource = Buffer.Pointer;
|
||||
/* Count number of resources */
|
||||
while (resource->Type != ACPI_RESOURCE_TYPE_END_TAG)
|
||||
while (resource->Type != ACPI_RESOURCE_TYPE_END_TAG && resource->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT)
|
||||
{
|
||||
if (resource->Type == ACPI_RESOURCE_TYPE_START_DEPENDENT)
|
||||
{
|
||||
if (SeenStartDependent)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SeenStartDependent = TRUE;
|
||||
}
|
||||
switch (resource->Type)
|
||||
{
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
|
@ -1433,9 +1443,18 @@ Bus_PDO_QueryResourceRequirements(
|
|||
RequirementDescriptor = RequirementsList->List[0].Descriptors;
|
||||
|
||||
/* Fill resources list structure */
|
||||
resource = Buffer.Pointer;
|
||||
SeenStartDependent = FALSE;
|
||||
resource = Buffer.Pointer;
|
||||
while (resource->Type != ACPI_RESOURCE_TYPE_END_TAG && resource->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT)
|
||||
{
|
||||
if (resource->Type == ACPI_RESOURCE_TYPE_START_DEPENDENT)
|
||||
{
|
||||
if (SeenStartDependent)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SeenStartDependent = TRUE;
|
||||
}
|
||||
switch (resource->Type)
|
||||
{
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
|
|
Loading…
Reference in a new issue