aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:39:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 20:39:40 -0500
commit06792c4dde2ad143928cc95c1ba218c6269c494b (patch)
tree92bdd4631612c9e3d8e5f6f06839f75c5473300a /include/asm-generic
parent4690dfa8cd66c37fbe99bb8cd5baa86102110776 (diff)
parent166c0eaedfc3157dc1394c27e827add19f05fb27 (diff)
Merge tag 'for-linux-3.3-merge-window' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming
* tag 'for-linux-3.3-merge-window' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming: (29 commits) C6X: replace tick_nohz_stop/restart_sched_tick calls C6X: add register_cpu call C6X: deal with memblock API changes C6X: fix timer64 initialization C6X: fix layout of EMIFA registers C6X: MAINTAINERS C6X: DSCR - Device State Configuration Registers C6X: EMIF - External Memory Interface C6X: general SoC support C6X: library code C6X: headers C6X: ptrace support C6X: loadable module support C6X: cache control C6X: clocks C6X: build infrastructure C6X: syscalls C6X: interrupt handling C6X: time management C6X: signal management ...
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/io.h2
-rw-r--r--include/asm-generic/page.h10
-rw-r--r--include/asm-generic/uaccess.h7
3 files changed, 14 insertions, 5 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 912088773a69..c2cf2eda0626 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -327,7 +327,7 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
327#define ioremap_wc ioremap_nocache 327#define ioremap_wc ioremap_nocache
328#endif 328#endif
329 329
330static inline void iounmap(void *addr) 330static inline void iounmap(void __iomem *addr)
331{ 331{
332} 332}
333#endif /* CONFIG_MMU */ 333#endif /* CONFIG_MMU */
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index 351889d1de19..37d1fe28960a 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -71,10 +71,14 @@ extern unsigned long memory_end;
71#define PAGE_OFFSET (0) 71#define PAGE_OFFSET (0)
72#endif 72#endif
73 73
74#ifndef ARCH_PFN_OFFSET
75#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
76#endif
77
74#ifndef __ASSEMBLY__ 78#ifndef __ASSEMBLY__
75 79
76#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) 80#define __va(x) ((void *)((unsigned long) (x)))
77#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) 81#define __pa(x) ((unsigned long) (x))
78 82
79#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) 83#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
80#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) 84#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
@@ -86,7 +90,7 @@ extern unsigned long memory_end;
86#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 90#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
87#endif 91#endif
88 92
89#define pfn_valid(pfn) ((pfn) < max_mapnr) 93#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
90 94
91#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ 95#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
92 ((void *)(kaddr) < (void *)memory_end)) 96 ((void *)(kaddr) < (void *)memory_end))
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index ac68c999b6c2..9788568f7978 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -289,9 +289,14 @@ strncpy_from_user(char *dst, const char __user *src, long count)
289 * Return 0 on exception, a value greater than N if too long 289 * Return 0 on exception, a value greater than N if too long
290 */ 290 */
291#ifndef __strnlen_user 291#ifndef __strnlen_user
292#define __strnlen_user strnlen 292#define __strnlen_user(s, n) (strnlen((s), (n)) + 1)
293#endif 293#endif
294 294
295/*
296 * Unlike strnlen, strnlen_user includes the nul terminator in
297 * its returned count. Callers should check for a returned value
298 * greater than N as an indication the string is too long.
299 */
295static inline long strnlen_user(const char __user *src, long n) 300static inline long strnlen_user(const char __user *src, long n)
296{ 301{
297 if (!access_ok(VERIFY_READ, src, 1)) 302 if (!access_ok(VERIFY_READ, src, 1))