Author: cgutman
Date: Fri Aug 19 23:11:03 2011
New Revision: 53329
URL:
http://svn.reactos.org/svn/reactos?rev=53329&view=rev
Log:
[HAL]
- Add (and fix) more validation and debugging
Modified:
trunk/reactos/hal/halx86/generic/acpi/halacpi.c
trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
==============================================================================
--- trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] Fri Aug 19 23:11:03 2011
@@ -948,6 +948,7 @@
ResourceList->InterfaceType = PNPBus;
ResourceList->List[0].Version = 1;
ResourceList->List[0].Revision = 1;
+ ResourceList->List[0].Count = 0;
/* Is there a SCI? */
if (HalpFixedAcpiDescTable.sci_int_vector)
@@ -981,10 +982,12 @@
/* Get ACPI resources */
HalpAcpiDetectResourceListSize(&Count);
+ DPRINT1("Resource count: %d\n", Count);
/* Compute size of the list and allocate it */
ListSize = FIELD_OFFSET(IO_RESOURCE_REQUIREMENTS_LIST, List[0].Descriptors) +
((Count - 1) * sizeof(IO_RESOURCE_DESCRIPTOR));
+ DPRINT1("Resource list size: %d\n", ListSize);
RequirementsList = ExAllocatePoolWithTag(PagedPool, ListSize, ' laH');
if (RequirementsList)
{
@@ -998,6 +1001,9 @@
{
/* It worked, return it */
*Requirements = RequirementsList;
+
+ /* Validate the list */
+ ASSERT(RequirementsList->List[0].Count == Count);
}
else
{
Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
==============================================================================
--- trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Fri Aug 19 23:11:03
2011
@@ -353,8 +353,9 @@
{
/* Query ACPI requirements */
Status = HalpQueryAcpiResourceRequirements(&RequirementsList);
+ if (!NT_SUCCESS(Status)) return Status;
+
ASSERT(RequirementsList->AlternativeLists == 1);
- if (!NT_SUCCESS(Status)) return Status;
/* Allocate the resourcel ist */
ResourceList = ExAllocatePoolWithTag(PagedPool,