Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36575
b: refs/heads/master
c: 51635ad
h: refs/heads/master
i:
  36573: da77e19
  36571: fbf243a
  36567: 8f667a0
  36559: 9b7a2a6
  36543: 4855b40
v: v3
  • Loading branch information
Lennert Buytenhek authored and Russell King committed Sep 25, 2006
1 parent efed67d commit f7c6a02
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf11d26cb96fe8221ef056eedab692e91634cc65
refs/heads/master: 51635ad282ead58b9d164f07e1fb62a9456b427c
22 changes: 22 additions & 0 deletions trunk/arch/arm/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,25 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
}
}


/*
* You really shouldn't be using read() or write() on /dev/mem. This
* might go away in the future.
*/
int valid_phys_addr_range(unsigned long addr, size_t size)
{
if (addr + size > __pa(high_memory))
return 0;

return 1;
}

/*
* We don't use supersection mappings for mmap() on /dev/mem, which
* means that we can't map the memory area above the 4G barrier into
* userspace.
*/
int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
{
return !(pfn + (size >> PAGE_SHIFT) > 0x00100000);
}
4 changes: 4 additions & 0 deletions trunk/include/asm-arm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
#define BIOVEC_MERGEABLE(vec1, vec2) \
((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))

#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
extern int valid_phys_addr_range(unsigned long addr, size_t size);
extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);

/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
* access
Expand Down

0 comments on commit f7c6a02

Please sign in to comment.