diff options
| author | Russell King <rmk@flint.arm.linux.org.uk> | 2003-06-19 02:14:04 +0100 |
|---|---|---|
| committer | Russell King <rmk@flint.arm.linux.org.uk> | 2003-06-19 02:14:04 +0100 |
| commit | 124116bb333774330f75c103b16b419db3a15ea3 (patch) | |
| tree | 908e8837d27ce150423382970416011c7e8b238c /include | |
| parent | 4760b9d99c313e559d6e52b35240e49e6108b92d (diff) | |
[ARM] Tighten virt_addr_valid(), add comments for __pa and friends.
Ensure virt_addr_valid(x) works correctly for pointers.
Add comments indicating that drivers should not use virt_to_phys
and/or __pa to obtain an address for DMA.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/memory.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index 38682a28d121..1b61a0e02c20 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -27,6 +27,9 @@ /* * These are *only* valid on the kernel direct mapped RAM memory. + * Note: Drivers should NOT use these. They are the wrong + * translation for translating DMA addresses. Use the driver + * DMA support - see dma-mapping.h. */ static inline unsigned long virt_to_phys(void *x) { @@ -38,6 +41,9 @@ static inline void *phys_to_virt(unsigned long x) return (void *)(__phys_to_virt((unsigned long)(x))); } +/* + * Drivers should NOT use these either. + */ #define __pa(x) __virt_to_phys((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) @@ -72,7 +78,7 @@ static inline void *phys_to_virt(unsigned long x) #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) #define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) -#define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory) +#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) #define PHYS_TO_NID(addr) (0) |
