Re: METHOD_NEITHER and buffer alignment
- From: "Doron Holan [MSFT]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Jan 2008 17:03:14 -0800
so if the app allocates a buffer >= page_size it should be aligned as best you need it. WdfDeviceSetAlignmentRequirement effects buffer alignment for DMA. why are you using method_neither to begin with? how big is the buffer?
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx> wrote in message news:%23v872$IWIHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
Virtual to physical mapping has page granularity. So, the ( VA %
PAGE_SIZE ) value (which is Mdl->ByteOffset) is the same for all mappings of
the page and also for the physical address.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
"Michael" <Michael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FAFBC328-03E1-4923-8B19-186459C5B24D@xxxxxxxxxxxxxxxx
In running some experiments, it doesn't seem to be the case that user spacethat it
virtual addresses and corresponding physical addresses have the same
alignment. Why would that be?
"Maxim S. Shatskih" wrote:
> > How can this requirement be imposed on the app?
>
> By documentation for app developers.
>
> >Is there a way for an
> > application to know the corresponding physical address of a buffer so
> > can keep all of it's buffers aligned properly on 64 byte physicaladdresses?>addresses,
> Alignment within a page is the same for both physical and virtual
> it's obvious.round
>
> BTW - 8byte is the usual allocation alignment for both user- and > kernel-
> allocators. To get 64byte alignment, allocate ( N + 63 ) bytes and then> the base address of the allocated block up.
>
> -- > Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@xxxxxxxxxxxxxxxx
> http://www.storagecraft.com
>
>
.
- References:
- Re: METHOD_NEITHER and buffer alignment
- From: Maxim S. Shatskih
- Re: METHOD_NEITHER and buffer alignment
- From: Maxim S. Shatskih
- Re: METHOD_NEITHER and buffer alignment
- From: Maxim S. Shatskih
- Re: METHOD_NEITHER and buffer alignment
- Prev by Date: Re: KDMF Driver status Code 37 after Last Known configuration
- Next by Date: USB Isochronous and Vista
- Previous by thread: Re: METHOD_NEITHER and buffer alignment
- Next by thread: Re: METHOD_NEITHER and buffer alignment
- Index(es):
Relevant Pages
|