Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119041
b: refs/heads/master
c: 185aed7
h: refs/heads/master
i:
  119039: 45ddee2
v: v3
  • Loading branch information
Paul Mundt committed Nov 12, 2008
1 parent a344559 commit 0bf8a97
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ade7a9b4ccd20ab8159c77a0abd20552f2d6b06c
refs/heads/master: 185aed75570fb4f78ef283dfa26cd9da5fa06a91
4 changes: 4 additions & 0 deletions trunk/arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
*/
#define xlate_dev_kmem_ptr(p) p

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

#endif /* __KERNEL__ */

#endif /* __ASM_SH_IO_H */
2 changes: 1 addition & 1 deletion trunk/arch/sh/mm/Makefile_32
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the Linux SuperH-specific parts of the memory manager.
#

obj-y := init.o extable_32.o consistent.o
obj-y := init.o extable_32.o consistent.o mmap.o

ifndef CONFIG_CACHE_OFF
cache-$(CONFIG_CPU_SH2) := cache-sh2.o
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/mm/Makefile_64
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the Linux SuperH-specific parts of the memory manager.
#

obj-y := init.o consistent.o
obj-y := init.o consistent.o mmap.o

mmu-y := tlb-nommu.o pg-nommu.o extable_32.o
mmu-$(CONFIG_MMU) := fault_64.o ioremap_64.o tlbflush_64.o tlb-sh5.o \
Expand Down
31 changes: 31 additions & 0 deletions trunk/arch/sh/mm/mmap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* arch/sh/mm/mmap.c
*
* Copyright (C) 2008 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/io.h>
#include <linux/mm.h>
#include <asm/page.h>

/*
* 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 count)
{
if (addr < (PAGE_OFFSET + (PFN_START << PAGE_SHIFT)))
return 0;
if (addr + count > __pa(high_memory))
return 0;

return 1;
}

int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
{
return 1;
}

0 comments on commit 0bf8a97

Please sign in to comment.