From afd42a4d3f30dffef25761c70e2ce4a5721569c5 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 19 Jul 2007 01:49:15 -0700 Subject: [PATCH] --- yaml --- r: 61654 b: refs/heads/master c: 10146801e8b960d7473e350b60458d9d5a2be1cf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/m68knommu/kernel/m68k_ksyms.c | 2 -- trunk/arch/m68knommu/mm/memory.c | 20 -------------------- trunk/include/asm-m68knommu/pgtable.h | 1 - trunk/include/asm-m68knommu/uaccess.h | 11 +++++++---- 5 files changed, 8 insertions(+), 28 deletions(-) diff --git a/[refs] b/[refs] index dd4ed5b99bbc..632b17099c2c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4c8b9159000018b0c641b844795a4de4e954582 +refs/heads/master: 10146801e8b960d7473e350b60458d9d5a2be1cf diff --git a/trunk/arch/m68knommu/kernel/m68k_ksyms.c b/trunk/arch/m68knommu/kernel/m68k_ksyms.c index 25327c9eadd7..f795062aba1e 100644 --- a/trunk/arch/m68knommu/kernel/m68k_ksyms.c +++ b/trunk/arch/m68knommu/kernel/m68k_ksyms.c @@ -81,8 +81,6 @@ EXPORT_SYMBOL(__mulsi3); EXPORT_SYMBOL(__udivsi3); EXPORT_SYMBOL(__umodsi3); -EXPORT_SYMBOL(is_in_rom); - #ifdef CONFIG_COLDFIRE extern unsigned int *dma_device_address; extern unsigned long dma_base_addr, _ramend; diff --git a/trunk/arch/m68knommu/mm/memory.c b/trunk/arch/m68knommu/mm/memory.c index 1a66b71035a4..f93b88b51f9f 100644 --- a/trunk/arch/m68knommu/mm/memory.c +++ b/trunk/arch/m68knommu/mm/memory.c @@ -33,23 +33,3 @@ unsigned long kernel_map(unsigned long paddr, unsigned long size, return paddr; } - -int is_in_rom(unsigned long addr) -{ - extern unsigned long _ramstart, _ramend; - - /* - * What we are really trying to do is determine if addr is - * in an allocated kernel memory region. If not then assume - * we cannot free it or otherwise de-allocate it. Ideally - * we could restrict this to really being in a ROM or flash, - * but that would need to be done on a board by board basis, - * not globally. - */ - if ((addr < _ramstart) || (addr >= _ramend)) - return(1); - - /* Default case, not in ROM */ - return(0); -} - diff --git a/trunk/include/asm-m68knommu/pgtable.h b/trunk/include/asm-m68knommu/pgtable.h index 9dfbbc24aa71..e1e6a1d2333a 100644 --- a/trunk/include/asm-m68knommu/pgtable.h +++ b/trunk/include/asm-m68knommu/pgtable.h @@ -49,7 +49,6 @@ static inline int pte_file(pte_t pte) { return 0; } * These would be in other places but having them here reduces the diffs. */ extern unsigned int kobjsize(const void *objp); -extern int is_in_rom(unsigned long); /* * No page table caches to initialise. diff --git a/trunk/include/asm-m68knommu/uaccess.h b/trunk/include/asm-m68knommu/uaccess.h index 62b29b10bc6d..9ed9169a8849 100644 --- a/trunk/include/asm-m68knommu/uaccess.h +++ b/trunk/include/asm-m68knommu/uaccess.h @@ -15,12 +15,15 @@ #define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) +/* + * It is not enough to just have access_ok check for a real RAM address. + * This would disallow the case of code/ro-data running XIP in flash/rom. + * Ideally we would check the possible flash ranges too, but that is + * currently not so easy. + */ static inline int _access_ok(unsigned long addr, unsigned long size) { - extern unsigned long memory_start, memory_end; - - return (((addr >= memory_start) && (addr+size < memory_end)) || - (is_in_rom(addr) && is_in_rom(addr+size))); + return 1; } /*