X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-m68knommu%2Fuaccess.h;h=68bbe9b312f149e5286068a90bbe59310176747b;hb=ebb12db51f6c13b30752fcf506baad4c617b153c;hp=62b29b10bc6dbca19ba2635bdb3dd247db82c120;hpb=7b69a4c360e8787877ebf5e42609b8bab13afa6a;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 62b29b10bc6..68bbe9b312f 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/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; } /* @@ -167,10 +170,12 @@ static inline long strnlen_user(const char *src, long n) */ static inline unsigned long -clear_user(void *to, unsigned long n) +__clear_user(void *to, unsigned long n) { memset(to, 0, n); return 0; } +#define clear_user(to,n) __clear_user(to,n) + #endif /* _M68KNOMMU_UACCESS_H */