| To: | Ralf Baechle <ralf@linux-mips.org> |
|---|---|
| Subject: | Re: pci_alloc_consistent usage |
| From: | Christoph Hellwig <hch@infradead.org> |
| Date: | Tue, 27 May 2003 12:33:29 +0100 |
| Cc: | Atsushi Nemoto <anemo@mba.ocn.ne.jp>, wgowcher@yahoo.com, linux-mips@linux-mips.org |
| In-reply-to: | <20030527112237.GA24905@linux-mips.org>; from ralf@linux-mips.org on Tue, May 27, 2003 at 01:22:37PM +0200 |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| References: | <20030523215935.71373.qmail@web11901.mail.yahoo.com> <20030527091740.GA23296@linux-mips.org> <20030527.190749.39150100.nemoto@toshiba-tops.co.jp> <20030527115322.A7124@infradead.org> <20030527112237.GA24905@linux-mips.org> |
| Sender: | linux-mips-bounce@linux-mips.org |
| User-agent: | Mutt/1.2.5.1i |
On Tue, May 27, 2003 at 01:22:37PM +0200, Ralf Baechle wrote: > [...] > portably refer to any piece of memory. If you have a cpu pointer > (which may be validly DMA'd too) you may easily obtain the page > and offset using something like this: > > > struct page *page = virt_to_page(ptr); > unsigned long offset = ((unsigned long)ptr & ~PAGE_MASK); > [...] > > While it's officially documented I still don't like it. Hmm, I remembered that some ports used vmalloc-like allocators for this and virt_to_page doesn't work for those.. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: pci_alloc_consistent usage, Ralf Baechle |
|---|---|
| Next by Date: | Re: pci_alloc_consistent usage, Ralf Baechle |
| Previous by Thread: | Re: pci_alloc_consistent usage, Ralf Baechle |
| Next by Thread: | Re: pci_alloc_consistent usage, Ralf Baechle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |