mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
[HAL]
- Add (and fix) more validation and debugging svn path=/trunk/; revision=53329
This commit is contained in:
@@ -948,6 +948,7 @@ HalpBuildAcpiResourceList(IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceList)
|
||||
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 @@ HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requiremen
|
||||
|
||||
/* 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 @@ HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requiremen
|
||||
{
|
||||
/* It worked, return it */
|
||||
*Requirements = RequirementsList;
|
||||
|
||||
/* Validate the list */
|
||||
ASSERT(RequirementsList->List[0].Count == Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -353,9 +353,10 @@ HalpQueryResources(IN PDEVICE_OBJECT DeviceObject,
|
||||
{
|
||||
/* Query ACPI requirements */
|
||||
Status = HalpQueryAcpiResourceRequirements(&RequirementsList);
|
||||
ASSERT(RequirementsList->AlternativeLists == 1);
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
||||
ASSERT(RequirementsList->AlternativeLists == 1);
|
||||
|
||||
/* Allocate the resourcel ist */
|
||||
ResourceList = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(CM_RESOURCE_LIST),
|
||||
|
||||
Reference in New Issue
Block a user