aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 13:11:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 13:11:25 -0400
commit7b7adc4a016a1decb806eb71ecab98721fa7f146 (patch)
tree0a6f9a6e5659faa94604fbc575382a18f143c657 /include/asm-generic
parent31598e8713ef501c8f6aad2e2ec8a9457e8877c1 (diff)
parent289d6b0e287e0acd85f3e6b7ea6c2cb5c234909a (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32: (40 commits) unicore32: rewrite arch-specific tlb.h to use asm-generic version unicore32: modify io_p2v and io_v2p macros, and adjust PKUNITY_mmio_BASEs unicore32: replace unicore32-specific iomap functions with generic lib implementation unicore32 machine related: add frame buffer driver for pkunity-v3 soc unicore32 machine related files: add i2c bus drivers for pkunity-v3 soc unicore32 io: redefine __REG(x) and re-use readl/writel funcs unicore32 i8042 upgrade and bugfix: adjust resource request region type unicore32 upgrade to v2.6.38-rc5: add one more paramter for pte_alloc_map call unicore32 i8042: adjust io funcs of i8042-unicore32io.h unicore32: rename PKUNITY_IOSPACE_BASE to PKUNITY_MMIO_BASE unicore32: modify function names and parameters for irq_chips unicore32: remove unused lines in arch/unicore32/include/asm/irq.h unicore32 time.c: change calculate method for clock_event_device unicore32: ADD MAINTAINER for unicore32 architecture unicore32 machine related files: ps2 driver unicore32 machine related files: pci bus handling unicore32 machine related files: hardware registers unicore32 machine related files: core files unicore32 additional architecture files: boot process unicore32 additional architecture files: low-level lib: misc ... Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/ftrace.h16
-rw-r--r--include/asm-generic/io.h33
-rw-r--r--include/asm-generic/sizes.h47
-rw-r--r--include/asm-generic/uaccess.h8
4 files changed, 87 insertions, 17 deletions
diff --git a/include/asm-generic/ftrace.h b/include/asm-generic/ftrace.h
new file mode 100644
index 00000000000..51abba9ea7a
--- /dev/null
+++ b/include/asm-generic/ftrace.h
@@ -0,0 +1,16 @@
1/*
2 * linux/include/asm-generic/ftrace.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_GENERIC_FTRACE_H__
9#define __ASM_GENERIC_FTRACE_H__
10
11/*
12 * Not all architectures need their own ftrace.h, the most
13 * common definitions are already in linux/ftrace.h.
14 */
15
16#endif /* __ASM_GENERIC_FTRACE_H__ */
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 4644c9a7f72..e0ffa3ddb02 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -94,6 +94,10 @@ static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
94#define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr) 94#define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr)
95#endif 95#endif
96 96
97#ifndef PCI_IOBASE
98#define PCI_IOBASE ((void __iomem *) 0)
99#endif
100
97/*****************************************************************************/ 101/*****************************************************************************/
98/* 102/*
99 * traditional input/output functions 103 * traditional input/output functions
@@ -101,32 +105,32 @@ static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
101 105
102static inline u8 inb(unsigned long addr) 106static inline u8 inb(unsigned long addr)
103{ 107{
104 return readb((volatile void __iomem *) addr); 108 return readb(addr + PCI_IOBASE);
105} 109}
106 110
107static inline u16 inw(unsigned long addr) 111static inline u16 inw(unsigned long addr)
108{ 112{
109 return readw((volatile void __iomem *) addr); 113 return readw(addr + PCI_IOBASE);
110} 114}
111 115
112static inline u32 inl(unsigned long addr) 116static inline u32 inl(unsigned long addr)
113{ 117{
114 return readl((volatile void __iomem *) addr); 118 return readl(addr + PCI_IOBASE);
115} 119}
116 120
117static inline void outb(u8 b, unsigned long addr) 121static inline void outb(u8 b, unsigned long addr)
118{ 122{
119 writeb(b, (volatile void __iomem *) addr); 123 writeb(b, addr + PCI_IOBASE);
120} 124}
121 125
122static inline void outw(u16 b, unsigned long addr) 126static inline void outw(u16 b, unsigned long addr)
123{ 127{
124 writew(b, (volatile void __iomem *) addr); 128 writew(b, addr + PCI_IOBASE);
125} 129}
126 130
127static inline void outl(u32 b, unsigned long addr) 131static inline void outl(u32 b, unsigned long addr)
128{ 132{
129 writel(b, (volatile void __iomem *) addr); 133 writel(b, addr + PCI_IOBASE);
130} 134}
131 135
132#define inb_p(addr) inb(addr) 136#define inb_p(addr) inb(addr)
@@ -213,32 +217,32 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
213 217
214static inline void readsl(const void __iomem *addr, void *buf, int len) 218static inline void readsl(const void __iomem *addr, void *buf, int len)
215{ 219{
216 insl((unsigned long)addr, buf, len); 220 insl(addr - PCI_IOBASE, buf, len);
217} 221}
218 222
219static inline void readsw(const void __iomem *addr, void *buf, int len) 223static inline void readsw(const void __iomem *addr, void *buf, int len)
220{ 224{
221 insw((unsigned long)addr, buf, len); 225 insw(addr - PCI_IOBASE, buf, len);
222} 226}
223 227
224static inline void readsb(const void __iomem *addr, void *buf, int len) 228static inline void readsb(const void __iomem *addr, void *buf, int len)
225{ 229{
226 insb((unsigned long)addr, buf, len); 230 insb(addr - PCI_IOBASE, buf, len);
227} 231}
228 232
229static inline void writesl(const void __iomem *addr, const void *buf, int len) 233static inline void writesl(const void __iomem *addr, const void *buf, int len)
230{ 234{
231 outsl((unsigned long)addr, buf, len); 235 outsl(addr - PCI_IOBASE, buf, len);
232} 236}
233 237
234static inline void writesw(const void __iomem *addr, const void *buf, int len) 238static inline void writesw(const void __iomem *addr, const void *buf, int len)
235{ 239{
236 outsw((unsigned long)addr, buf, len); 240 outsw(addr - PCI_IOBASE, buf, len);
237} 241}
238 242
239static inline void writesb(const void __iomem *addr, const void *buf, int len) 243static inline void writesb(const void __iomem *addr, const void *buf, int len)
240{ 244{
241 outsb((unsigned long)addr, buf, len); 245 outsb(addr - PCI_IOBASE, buf, len);
242} 246}
243 247
244#ifndef CONFIG_GENERIC_IOMAP 248#ifndef CONFIG_GENERIC_IOMAP
@@ -269,8 +273,9 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len)
269 outsl((unsigned long) (p), (src), (count)) 273 outsl((unsigned long) (p), (src), (count))
270#endif /* CONFIG_GENERIC_IOMAP */ 274#endif /* CONFIG_GENERIC_IOMAP */
271 275
272 276#ifndef IO_SPACE_LIMIT
273#define IO_SPACE_LIMIT 0xffffffff 277#define IO_SPACE_LIMIT 0xffff
278#endif
274 279
275#ifdef __KERNEL__ 280#ifdef __KERNEL__
276 281
diff --git a/include/asm-generic/sizes.h b/include/asm-generic/sizes.h
new file mode 100644
index 00000000000..ea5d4ef8106
--- /dev/null
+++ b/include/asm-generic/sizes.h
@@ -0,0 +1,47 @@
1/*
2 * linux/include/asm-generic/sizes.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_GENERIC_SIZES_H__
9#define __ASM_GENERIC_SIZES_H__
10
11#define SZ_1 0x00000001
12#define SZ_2 0x00000002
13#define SZ_4 0x00000004
14#define SZ_8 0x00000008
15#define SZ_16 0x00000010
16#define SZ_32 0x00000020
17#define SZ_64 0x00000040
18#define SZ_128 0x00000080
19#define SZ_256 0x00000100
20#define SZ_512 0x00000200
21
22#define SZ_1K 0x00000400
23#define SZ_2K 0x00000800
24#define SZ_4K 0x00001000
25#define SZ_8K 0x00002000
26#define SZ_16K 0x00004000
27#define SZ_32K 0x00008000
28#define SZ_64K 0x00010000
29#define SZ_128K 0x00020000
30#define SZ_256K 0x00040000
31#define SZ_512K 0x00080000
32
33#define SZ_1M 0x00100000
34#define SZ_2M 0x00200000
35#define SZ_4M 0x00400000
36#define SZ_8M 0x00800000
37#define SZ_16M 0x01000000
38#define SZ_32M 0x02000000
39#define SZ_64M 0x04000000
40#define SZ_128M 0x08000000
41#define SZ_256M 0x10000000
42#define SZ_512M 0x20000000
43
44#define SZ_1G 0x40000000
45#define SZ_2G 0x80000000
46
47#endif /* __ASM_GENERIC_SIZES_H__ */
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index b218b8513d0..ac68c999b6c 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -288,14 +288,16 @@ strncpy_from_user(char *dst, const char __user *src, long count)
288 * 288 *
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
293#endif
294
292static inline long strnlen_user(const char __user *src, long n) 295static inline long strnlen_user(const char __user *src, long n)
293{ 296{
294 if (!access_ok(VERIFY_READ, src, 1)) 297 if (!access_ok(VERIFY_READ, src, 1))
295 return 0; 298 return 0;
296 return strlen((void * __force)src) + 1; 299 return __strnlen_user(src, n);
297} 300}
298#endif
299 301
300static inline long strlen_user(const char __user *src) 302static inline long strlen_user(const char __user *src)
301{ 303{