Prev: USB Device versus Interface
Next: Why is #pragma comment(lib, "atlthunk.lib") needed in source file?
From: hitesh on 26 Aug 2010 01:19 hi, as HW initialize routine runs @ DIRQ level it is not possible to allocate memory. what if i allocate memory in HwStorPassiveInitRoutine( )? is it allowed to allocate memory? i am trying to allocate in HwStorPassiveInitRoutine but system crashes, does anybody have any idea? ~hitesh
From: hitesh on 26 Aug 2010 02:18 On Aug 26, 10:19 am, hitesh <hitesh.ughr...(a)gmail.com> wrote: > hi, > as HW initialize routine runs @ DIRQ level it is not possible to > allocate memory. > what if i allocate memory in HwStorPassiveInitRoutine( )? > is it allowed to allocate memory? > i am trying to allocate in HwStorPassiveInitRoutine but system > crashes, > does anybody have any idea? > ~hitesh one more starnge behavious i have seen, i have allocated a memory using storportallocatepool () which will give non paged pool. if physically it is contiguous then if i call the function StorPortGetPhysicalAddress ( ) should return length as total size of allocated memory with physical address. but what i found , it returns some 640 bytes as length everytime i call the function to get the physical address. i make sure that memory is contiguous by checking the input address to function increment by return length. what if i want to allocate memory in run time. i have used my all memory whcih i allocated using StorportGetUncachedExtension( ). ~hitesh
From: eagersh on 26 Aug 2010 12:45 On Aug 25, 11:19 pm, hitesh <hitesh.ughr...(a)gmail.com> wrote: > hi, > as HW initialize routine runs @ DIRQ level it is not possible to > allocate memory. > what if i allocate memory in HwStorPassiveInitRoutine( )? > is it allowed to allocate memory? > i am trying to allocate in HwStorPassiveInitRoutine but system > crashes, > does anybody have any idea? > ~hitesh Which function do you use? StorPortAllocatePool should work fine. Igor Sharovar
From: eagersh on 26 Aug 2010 12:51
On Aug 26, 12:18 am, hitesh <hitesh.ughr...(a)gmail.com> wrote: > On Aug 26, 10:19 am, hitesh <hitesh.ughr...(a)gmail.com> wrote: > > > hi, > > as HW initialize routine runs @ DIRQ level it is not possible to > > allocate memory. > > what if i allocate memory in HwStorPassiveInitRoutine( )? > > is it allowed to allocate memory? > > i am trying to allocate in HwStorPassiveInitRoutine but system > > crashes, > > does anybody have any idea? > > ~hitesh > > one more starnge behavious i have seen, > i have allocated a memory using storportallocatepool () which will > give non paged pool. > if physically it is contiguous then if i call the function > StorPortGetPhysicalAddress ( ) should return length as total size of > allocated memory with physical address. > but what i found , it returns some 640 bytes as length everytime i > call the function to get the physical address. i make sure that memory > is contiguous by checking the input address to function increment by > return length. > what if i want to allocate memory in run time. i have used my all > memory whcih i allocated using StorportGetUncachedExtension( ). > ~hitesh WDK documentation is not clear about return value. It does not say implicitly it returns total mapped length. I would say it returns the size of memory in the first mapped page. Usually a length in the first element in MDL contains such value. Igor Sharovar |