Hi,
after a call to HalAssignSlotResources() for a PCI device, the base address
registers seems to change sometimes (which I guess is as expected to avoid
resource conflicts).
Assuming I need to map the memory described in BAR[0] and BAR - how do I
identify these addresses?
I see two ways of doing this:
-
Use HalGetBusData() to get the PCI_COMMON_CONFIG structure again after
calling HalAssignSlotResources(), then match BaseAddress[0] and
BaseAddress with the memory resources returned from HASR().
-
Assume the relative order of the memory resources returned from
HalAssignSlotResources() are the same as in the BARs. I.e. just loop through
the CM_PARTIAL_RESOURCES_DESCRIPTORs and get the 0th and Xth one.
Item 1 makes more sense to me - advise anyone? Is there any other way?
// Johan
You can assume that the order of the returned resources is the order of the
valid bars. I would agree with you though that it certainly would be NICE IF
THIS WERE DOCUMENTED. If you are paranoid (and sometimes they really are out
to get you,) you can also take your choice 1, which works, but is very
annoying.
Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
WindowsNT Windows 2000 Consulting Services
-----Original Message-----
From: xxxxx@esrange.ssc.se
[mailto:xxxxx@esrange.ssc.se]
Sent: Friday, November 10, 2000 4:47 AM
To: NT Developers Interest List
Subject: [ntdev] HalAssignSlotResources
Hi,
after a call to HalAssignSlotResources() for a PCI device,
the base address
registers seems to change sometimes (which I guess is as
expected to avoid
resource conflicts).
Assuming I need to map the memory described in BAR[0] and
BAR - how do I
identify these addresses?
I see two ways of doing this:
-
Use HalGetBusData() to get the PCI_COMMON_CONFIG structure
again after
calling HalAssignSlotResources(), then match BaseAddress[0] and
BaseAddress with the memory resources returned from HASR().
-
Assume the relative order of the memory resources returned from
HalAssignSlotResources() are the same as in the BARs. I.e.
just loop through
the CM_PARTIAL_RESOURCES_DESCRIPTORs and get the 0th and Xth one.
Item 1 makes more sense to me - advise anyone? Is there any other way?
// Johan
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> 2) Assume the relative order of the memory resources returned from
HalAssignSlotResources() are the same as in the BARs. I.e. just loop
Yes, it is always so.
We have rev.eng.ed this function in NT4 about a year ago.
Max
Just for the “fun” of it - I might as well go for choice #1.
You never know, do you …
Thanks // Johan
-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: den 10 november 2000 15:56
To: NT Developers Interest List
Subject: [ntdev] RE: HalAssignSlotResources
You can assume that the order of the returned resources is
the order of the
valid bars. I would agree with you though that it certainly
would be NICE IF
THIS WERE DOCUMENTED. If you are paranoid (and sometimes they
really are out
to get you,) you can also take your choice 1, which works, but is very
annoying.
Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
WindowsNT Windows 2000 Consulting Services
> -----Original Message-----
> From: xxxxx@esrange.ssc.se
> [mailto:xxxxx@esrange.ssc.se]
> Sent: Friday, November 10, 2000 4:47 AM
> To: NT Developers Interest List
> Subject: [ntdev] HalAssignSlotResources
>
>
> Hi,
>
> after a call to HalAssignSlotResources() for a PCI device,
> the base address
> registers seems to change sometimes (which I guess is as
> expected to avoid
> resource conflicts).
>
> Assuming I need to map the memory described in BAR[0] and
> BAR - how do I
> identify these addresses?
>
> I see two ways of doing this:
>
> 1) Use HalGetBusData() to get the PCI_COMMON_CONFIG structure
> again after
> calling HalAssignSlotResources(), then match BaseAddress[0] and
> BaseAddress with the memory resources returned from HASR().
>
> 2) Assume the relative order of the memory resources returned from
> HalAssignSlotResources() are the same as in the BARs. I.e.
> just loop through
> the CM_PARTIAL_RESOURCES_DESCRIPTORs and get the 0th and Xth one.
>
> Item 1 makes more sense to me - advise anyone? Is there any
other way?
>
> // Johan
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
You are currently subscribed to ntdev as: xxxxx@esrange.ssc.se
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
Thanks for the info. Have you verified the implementation in w2k also?
Thanks // Johan
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: den 13 november 2000 22:34
To: NT Developers Interest List
Subject: [ntdev] Re: HalAssignSlotResources
> 2) Assume the relative order of the memory resources returned from
> HalAssignSlotResources() are the same as in the BARs. I.e.
just loop
Yes, it is always so.
We have rev.eng.ed this function in NT4 about a year ago.
Max
You are currently subscribed to ntdev as: xxxxx@esrange.ssc.se
To unsubscribe send a blank email to $subst(‘Email.Unsub’)