diff options
-rw-r--r-- | arch/m68knommu/kernel/m68k_ksyms.c | 2 | ||||
-rw-r--r-- | arch/m68knommu/mm/memory.c | 20 | ||||
-rw-r--r-- | include/asm-m68knommu/pgtable.h | 1 | ||||
-rw-r--r-- | include/asm-m68knommu/uaccess.h | 11 |
4 files changed, 7 insertions, 27 deletions
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c index 25327c9eadd..f795062aba1 100644 --- a/arch/m68knommu/kernel/m68k_ksyms.c +++ b/arch/m68knommu/kernel/m68k_ksyms.c | |||
@@ -81,8 +81,6 @@ EXPORT_SYMBOL(__mulsi3); | |||
81 | EXPORT_SYMBOL(__udivsi3); | 81 | EXPORT_SYMBOL(__udivsi3); |
82 | EXPORT_SYMBOL(__umodsi3); | 82 | EXPORT_SYMBOL(__umodsi3); |
83 | 83 | ||
84 | EXPORT_SYMBOL(is_in_rom); | ||
85 | |||
86 | #ifdef CONFIG_COLDFIRE | 84 | #ifdef CONFIG_COLDFIRE |
87 | extern unsigned int *dma_device_address; | 85 | extern unsigned int *dma_device_address; |
88 | extern unsigned long dma_base_addr, _ramend; | 86 | extern unsigned long dma_base_addr, _ramend; |
diff --git a/arch/m68knommu/mm/memory.c b/arch/m68knommu/mm/memory.c index 1a66b71035a..f93b88b51f9 100644 --- a/arch/m68knommu/mm/memory.c +++ b/arch/m68knommu/mm/memory.c | |||
@@ -33,23 +33,3 @@ unsigned long kernel_map(unsigned long paddr, unsigned long size, | |||
33 | return paddr; | 33 | return paddr; |
34 | } | 34 | } |
35 | 35 | ||
36 | |||
37 | int is_in_rom(unsigned long addr) | ||
38 | { | ||
39 | extern unsigned long _ramstart, _ramend; | ||
40 | |||
41 | /* | ||
42 | * What we are really trying to do is determine if addr is | ||
43 | * in an allocated kernel memory region. If not then assume | ||
44 | * we cannot free it or otherwise de-allocate it. Ideally | ||
45 | * we could restrict this to really being in a ROM or flash, | ||
46 | * but that would need to be done on a board by board basis, | ||
47 | * not globally. | ||
48 | */ | ||
49 | if ((addr < _ramstart) || (addr >= _ramend)) | ||
50 | return(1); | ||
51 | |||
52 | /* Default case, not in ROM */ | ||
53 | return(0); | ||
54 | } | ||
55 | |||
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h index 9dfbbc24aa7..e1e6a1d2333 100644 --- a/include/asm-m68knommu/pgtable.h +++ b/include/asm-m68knommu/pgtable.h | |||
@@ -49,7 +49,6 @@ static inline int pte_file(pte_t pte) { return 0; } | |||
49 | * These would be in other places but having them here reduces the diffs. | 49 | * These would be in other places but having them here reduces the diffs. |
50 | */ | 50 | */ |
51 | extern unsigned int kobjsize(const void *objp); | 51 | extern unsigned int kobjsize(const void *objp); |
52 | extern int is_in_rom(unsigned long); | ||
53 | 52 | ||
54 | /* | 53 | /* |
55 | * No page table caches to initialise. | 54 | * No page table caches to initialise. |
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 62b29b10bc6..9ed9169a884 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h | |||
@@ -15,12 +15,15 @@ | |||
15 | 15 | ||
16 | #define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) | 16 | #define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) |
17 | 17 | ||
18 | /* | ||
19 | * It is not enough to just have access_ok check for a real RAM address. | ||
20 | * This would disallow the case of code/ro-data running XIP in flash/rom. | ||
21 | * Ideally we would check the possible flash ranges too, but that is | ||
22 | * currently not so easy. | ||
23 | */ | ||
18 | static inline int _access_ok(unsigned long addr, unsigned long size) | 24 | static inline int _access_ok(unsigned long addr, unsigned long size) |
19 | { | 25 | { |
20 | extern unsigned long memory_start, memory_end; | 26 | return 1; |
21 | |||
22 | return (((addr >= memory_start) && (addr+size < memory_end)) || | ||
23 | (is_in_rom(addr) && is_in_rom(addr+size))); | ||
24 | } | 27 | } |
25 | 28 | ||
26 | /* | 29 | /* |