page_to_phys
Hi,
Currently in io_32.h page_to_phys is defined as:
#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT)
Should it not be:
#define page_to_phys(page) ((((page) - mem_map) << PAGE_SHIFT) + phys_base)
or perhaps:
#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
Best regards,
Kristoffer Glembo
From: Kristoffer Glembo <[email protected]>
Date: Fri, 09 Oct 2009 16:02:14 +0200
Quoted 6 lines
Currently in
io_32.hpage_to_physis defined as:#define
page_to_phys(page)(((page) -mem_map) <<PAGE_SHIFT)Should it not be:
Quoted 7 lines
#define
page_to_phys(page)((((page) -mem_map) <<PAGE_SHIFT) + #phys_base)or perhaps:
#define
page_to_phys(page)((dma_addr_t)page_to_pfn(page) << #PAGE_SHIFT)
Sparc 32-bit doesn't offset the mem_map at phys_base.
What is offset by phys_base is what gets mapped at PAGE_OFFSET virtually.
That's why the things that translate between virtual and physical addresses do take phys_base into account.
Quoting David Miller <[email protected]>:
Quoted 6 lines
Sparc 32-bit doesn't offset the
mem_mapatphys_base.What is offset by
phys_baseis what gets mapped atPAGE_OFFSETvirtually.
Thanks for the clarification. Got temporarily confused. :-)
Best regards,
Kristoffer Glembo