Hello SIr,
I used HalAssignSlotResources function to get Interrupt no, Interrupt
level,and Base addresses. I used NT checked version in debug mode for
development. In WinDbg application HalAssignSlotResources giving message
that it acquired 3 resources and displaying all the information, but when I
tried to access the PCM_RESOURCE_LIST variable Count, it is showing value
as a 1, and that is for interrupt related information. I was not able to
access the memory and IO base addresses.
The part of debug information is :
Alternative #0 - 3 required resources
*** INT Min: c, Max: c
*** P IO Min: 0:00002000, Max: 0:000020ff, Algn: 100, Len 100
IO Min: 0:00002000, Max: 0:000020ff, Algn: 100, Len 100
*** P MEM Min: 0:fd000000, Max: 0:fd0003ff, Algn: 400, Len 400
MEM Min: 0:fd000000, Max: 0:fd0003ff, Algn: 400, Len 400
Acquired Resourses - 3
INT Level c, Vector c
IO Start 0:00002000, Len 100
MEM Start 0:fd000000, Len 400
HalAssignSlotResources returns STATUS_SUCCESS
AssignedResources->Count = 1
Interrupt Vector = C
Interrupt level = C
Interrupt Flag = 0
The part source code is :
if(HalAssignSlotResources( &gRegistryPath,
NULL,
gDriverObject,
NULL,
PCIBus,
BusNo,
SlotNumber,
&AssignedResources) == STATUS_SUCCESS)
{
#ifdef INIT_DBG
DbgPrint(“HalAssignSlotResources returns STATUS_SUCCESS”);
#endif
}
else
{
#ifdef INIT_DBG
DbgPrint(“HalAssignSlotResources returns STATUS_FAILURE”);
#endif
}
#ifdef INIT_DBG
DbgPrint(“\nAssignedResources->Count = %x”, AssignedResources-
Count);
#endif
for( Index = 0; Index < AssignedResources->Count; Index++)
{
switch(AssignedResources->List-
PartialResourceList.PartialDescriptors[Index].Type)
{
case CmResourceTypePort :
*PortBaseAddress = AssignedResources->List-
PartialResourceList.PartialDescriptors[Index].u.Port.Start.LowPart;
*PortLength = (unsigned int)AssignedResources-
List->PartialResourceList.PartialDescriptors[Index].u.Port.Length;
#ifdef INIT_DBG
DbgPrint(“\nPortBaseAddress = %08lX \nPort Length = %x”,
*PortBaseAddress, *PortLength);
#endif
break;
case CmResourceTypeInterrupt :
*InterruptVector = (unsigned int)
AssignedResources->List->PartialResourceList.PartialDescriptors
[Index].u.Interrupt.Vector;
*InterruptLevel = (unsigned int)
AssignedResources->List->PartialResourceList.PartialDescriptors
[Index].u.Interrupt.Level;
*InterruptFlag = AssignedResources->List-
PartialResourceList.PartialDescriptors[Index].Flags;
#ifdef INIT_DBG
DbgPrint(“\nInterrupt Vector = %X \nInterrupt level = %X”,
*InterruptVector, *InterruptLevel);
DbgPrint(“\nInterrupt Flag = %X”, *InterruptFlag);
#endif
break;
case CmResourceTypeMemory :
*MemoryBaseAddress = AssignedResources->List-
PartialResourceList.PartialDescriptors[Index].u.Memory.Start.LowPart;
*MemoryLength = (unsigned int)AssignedResources-
List->PartialResourceList.PartialDescriptors[Index].u.Memory.Length;
#ifdef INIT_DBG
DbgPrint(“\nMemoryBaseAddress = %08lX \nMemory Length = %x”,
*MemoryBaseAddress, *MemoryLength);
#endif
break;
default :
break;
}
}
Waiting for help.
Thank you.
Regards,
Mohan
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com