aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/bug.h16
-rw-r--r--include/asm-generic/percpu.h2
-rw-r--r--include/asm-m68k/dma-mapping.h2
-rw-r--r--include/asm-m68k/string.h198
-rw-r--r--include/asm-m68k/system.h6
-rw-r--r--include/asm-m68k/user.h2
-rw-r--r--include/asm-s390/percpu.h4
-rw-r--r--include/asm-um/irq_regs.h1
-rw-r--r--include/asm-x86_64/percpu.h6
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mmc/protocol.h1
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/sched.h7
-rw-r--r--include/linux/sunrpc/svc.h3
-rw-r--r--include/linux/timex.h3
15 files changed, 120 insertions, 134 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index a5250895155e..1d9573cf4a0b 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -41,14 +41,14 @@
41#endif 41#endif
42#endif 42#endif
43 43
44#define WARN_ON_ONCE(condition) ({ \ 44#define WARN_ON_ONCE(condition) ({ \
45 static int __warn_once = 1; \ 45 static int __warned; \
46 typeof(condition) __ret_warn_once = (condition);\ 46 typeof(condition) __ret_warn_once = (condition); \
47 \ 47 \
48 if (likely(__warn_once)) \ 48 if (unlikely(__ret_warn_once)) \
49 if (WARN_ON(__ret_warn_once)) \ 49 if (WARN_ON(!__warned)) \
50 __warn_once = 0; \ 50 __warned = 1; \
51 unlikely(__ret_warn_once); \ 51 unlikely(__ret_warn_once); \
52}) 52})
53 53
54#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 6d45ee5472af..196376262240 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -15,7 +15,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
15 15
16/* var is in discarded region: offset to particular copy we want */ 16/* var is in discarded region: offset to particular copy we want */
17#define per_cpu(var, cpu) (*({ \ 17#define per_cpu(var, cpu) (*({ \
18 extern int simple_indentifier_##var(void); \ 18 extern int simple_identifier_##var(void); \
19 RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); })) 19 RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); }))
20#define __get_cpu_var(var) per_cpu(var, smp_processor_id()) 20#define __get_cpu_var(var) per_cpu(var, smp_processor_id())
21#define __raw_get_cpu_var(var) per_cpu(var, raw_smp_processor_id()) 21#define __raw_get_cpu_var(var) per_cpu(var, raw_smp_processor_id())
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index cebbb03370ec..c1299c3beb50 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -26,7 +26,7 @@ static inline int dma_is_consistent(dma_addr_t dma_addr)
26} 26}
27 27
28extern void *dma_alloc_coherent(struct device *, size_t, 28extern void *dma_alloc_coherent(struct device *, size_t,
29 dma_addr_t *, int); 29 dma_addr_t *, gfp_t);
30extern void dma_free_coherent(struct device *, size_t, 30extern void dma_free_coherent(struct device *, size_t,
31 void *, dma_addr_t); 31 void *, dma_addr_t);
32 32
diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h
index 6c59215b285e..2eb7df1e0f5d 100644
--- a/include/asm-m68k/string.h
+++ b/include/asm-m68k/string.h
@@ -1,138 +1,114 @@
1#ifndef _M68K_STRING_H_ 1#ifndef _M68K_STRING_H_
2#define _M68K_STRING_H_ 2#define _M68K_STRING_H_
3 3
4#include <asm/setup.h> 4#include <linux/types.h>
5#include <asm/page.h> 5#include <linux/compiler.h>
6 6
7#define __HAVE_ARCH_STRCPY 7static inline size_t __kernel_strlen(const char *s)
8static inline char * strcpy(char * dest,const char *src)
9{ 8{
10 char *xdest = dest; 9 const char *sc;
11
12 __asm__ __volatile__
13 ("1:\tmoveb %1@+,%0@+\n\t"
14 "jne 1b"
15 : "=a" (dest), "=a" (src)
16 : "0" (dest), "1" (src) : "memory");
17 return xdest;
18}
19 10
20#define __HAVE_ARCH_STRNCPY 11 for (sc = s; *sc++; )
21static inline char * strncpy(char *dest, const char *src, size_t n) 12 ;
22{ 13 return sc - s - 1;
23 char *xdest = dest;
24
25 if (n == 0)
26 return xdest;
27
28 __asm__ __volatile__
29 ("1:\tmoveb %1@+,%0@+\n\t"
30 "jeq 2f\n\t"
31 "subql #1,%2\n\t"
32 "jne 1b\n\t"
33 "2:"
34 : "=a" (dest), "=a" (src), "=d" (n)
35 : "0" (dest), "1" (src), "2" (n)
36 : "memory");
37 return xdest;
38} 14}
39 15
40#define __HAVE_ARCH_STRCAT 16static inline char *__kernel_strcpy(char *dest, const char *src)
41static inline char * strcat(char * dest, const char * src)
42{ 17{
43 char *tmp = dest; 18 char *xdest = dest;
44 19
45 while (*dest) 20 asm volatile ("\n"
46 dest++; 21 "1: move.b (%1)+,(%0)+\n"
47 while ((*dest++ = *src++)) 22 " jne 1b"
48 ; 23 : "+a" (dest), "+a" (src)
49 24 : : "memory");
50 return tmp; 25 return xdest;
51} 26}
52 27
53#define __HAVE_ARCH_STRNCAT 28#ifndef __IN_STRING_C
54static inline char * strncat(char *dest, const char *src, size_t count)
55{
56 char *tmp = dest;
57
58 if (count) {
59 while (*dest)
60 dest++;
61 while ((*dest++ = *src++)) {
62 if (--count == 0) {
63 *dest++='\0';
64 break;
65 }
66 }
67 }
68 29
69 return tmp; 30#define __HAVE_ARCH_STRLEN
70} 31#define strlen(s) (__builtin_constant_p(s) ? \
32 __builtin_strlen(s) : \
33 __kernel_strlen(s))
71 34
72#define __HAVE_ARCH_STRCHR 35#define __HAVE_ARCH_STRNLEN
73static inline char * strchr(const char * s, int c) 36static inline size_t strnlen(const char *s, size_t count)
74{ 37{
75 const char ch = c; 38 const char *sc = s;
76 39
77 for(; *s != ch; ++s) 40 asm volatile ("\n"
78 if (*s == '\0') 41 "1: subq.l #1,%1\n"
79 return( NULL ); 42 " jcs 2f\n"
80 return( (char *) s); 43 " tst.b (%0)+\n"
44 " jne 1b\n"
45 " subq.l #1,%0\n"
46 "2:"
47 : "+a" (sc), "+d" (count));
48 return sc - s;
81} 49}
82 50
83/* strstr !! */ 51#define __HAVE_ARCH_STRCPY
52#if __GNUC__ >= 4
53#define strcpy(d, s) (__builtin_constant_p(s) && \
54 __builtin_strlen(s) <= 32 ? \
55 __builtin_strcpy(d, s) : \
56 __kernel_strcpy(d, s))
57#else
58#define strcpy(d, s) __kernel_strcpy(d, s)
59#endif
84 60
85#define __HAVE_ARCH_STRLEN 61#define __HAVE_ARCH_STRNCPY
86static inline size_t strlen(const char * s) 62static inline char *strncpy(char *dest, const char *src, size_t n)
87{ 63{
88 const char *sc; 64 char *xdest = dest;
89 for (sc = s; *sc != '\0'; ++sc) ; 65
90 return(sc - s); 66 asm volatile ("\n"
67 " jra 2f\n"
68 "1: move.b (%1),(%0)+\n"
69 " jeq 2f\n"
70 " addq.l #1,%1\n"
71 "2: subq.l #1,%2\n"
72 " jcc 1b\n"
73 : "+a" (dest), "+a" (src), "+d" (n)
74 : : "memory");
75 return xdest;
91} 76}
92 77
93/* strnlen !! */ 78#define __HAVE_ARCH_STRCAT
79#define strcat(d, s) ({ \
80 char *__d = (d); \
81 strcpy(__d + strlen(__d), (s)); \
82})
94 83
95#define __HAVE_ARCH_STRCMP 84#define __HAVE_ARCH_STRCHR
96static inline int strcmp(const char * cs,const char * ct) 85static inline char *strchr(const char *s, int c)
97{ 86{
98 char __res; 87 char sc, ch = c;
99 88
100 __asm__ 89 for (; (sc = *s++) != ch; ) {
101 ("1:\tmoveb %0@+,%2\n\t" /* get *cs */ 90 if (!sc)
102 "cmpb %1@+,%2\n\t" /* compare a byte */ 91 return NULL;
103 "jne 2f\n\t" /* not equal, break out */ 92 }
104 "tstb %2\n\t" /* at end of cs? */ 93 return (char *)s - 1;
105 "jne 1b\n\t" /* no, keep going */
106 "jra 3f\n\t" /* strings are equal */
107 "2:\tsubb %1@-,%2\n\t" /* *cs - *ct */
108 "3:"
109 : "=a" (cs), "=a" (ct), "=d" (__res)
110 : "0" (cs), "1" (ct));
111 return __res;
112} 94}
113 95
114#define __HAVE_ARCH_STRNCMP 96#define __HAVE_ARCH_STRCMP
115static inline int strncmp(const char * cs,const char * ct,size_t count) 97static inline int strcmp(const char *cs, const char *ct)
116{ 98{
117 char __res; 99 char res;
118 100
119 if (!count) 101 asm ("\n"
120 return 0; 102 "1: move.b (%0)+,%2\n" /* get *cs */
121 __asm__ 103 " cmp.b (%1)+,%2\n" /* compare a byte */
122 ("1:\tmovb %0@+,%3\n\t" /* get *cs */ 104 " jne 2f\n" /* not equal, break out */
123 "cmpb %1@+,%3\n\t" /* compare a byte */ 105 " tst.b %2\n" /* at end of cs? */
124 "jne 3f\n\t" /* not equal, break out */ 106 " jne 1b\n" /* no, keep going */
125 "tstb %3\n\t" /* at end of cs? */ 107 " jra 3f\n" /* strings are equal */
126 "jeq 4f\n\t" /* yes, all done */ 108 "2: sub.b -(%1),%2\n" /* *cs - *ct */
127 "subql #1,%2\n\t" /* no, adjust count */ 109 "3:"
128 "jne 1b\n\t" /* more to do, keep going */ 110 : "+a" (cs), "+a" (ct), "=d" (res));
129 "2:\tmoveq #0,%3\n\t" /* strings are equal */ 111 return res;
130 "jra 4f\n\t"
131 "3:\tsubb %1@-,%3\n\t" /* *cs - *ct */
132 "4:"
133 : "=a" (cs), "=a" (ct), "=d" (count), "=d" (__res)
134 : "0" (cs), "1" (ct), "2" (count));
135 return __res;
136} 112}
137 113
138#define __HAVE_ARCH_MEMSET 114#define __HAVE_ARCH_MEMSET
@@ -150,4 +126,6 @@ extern void *memmove(void *, const void *, __kernel_size_t);
150extern int memcmp(const void *, const void *, __kernel_size_t); 126extern int memcmp(const void *, const void *, __kernel_size_t);
151#define memcmp(d, s, n) __builtin_memcmp(d, s, n) 127#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
152 128
129#endif
130
153#endif /* _M68K_STRING_H_ */ 131#endif /* _M68K_STRING_H_ */
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index 131a0cb0f491..243dd13e6bfc 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -78,13 +78,13 @@ static inline int irqs_disabled(void)
78#define mb() barrier() 78#define mb() barrier()
79#define rmb() barrier() 79#define rmb() barrier()
80#define wmb() barrier() 80#define wmb() barrier()
81#define read_barrier_depends() do { } while(0) 81#define read_barrier_depends() ((void)0)
82#define set_mb(var, value) do { xchg(&var, value); } while (0) 82#define set_mb(var, value) ({ (var) = (value); wmb(); })
83 83
84#define smp_mb() barrier() 84#define smp_mb() barrier()
85#define smp_rmb() barrier() 85#define smp_rmb() barrier()
86#define smp_wmb() barrier() 86#define smp_wmb() barrier()
87#define smp_read_barrier_depends() do { } while(0) 87#define smp_read_barrier_depends() ((void)0)
88 88
89 89
90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
diff --git a/include/asm-m68k/user.h b/include/asm-m68k/user.h
index e8d5a64c7e79..d7c0b109bd45 100644
--- a/include/asm-m68k/user.h
+++ b/include/asm-m68k/user.h
@@ -81,7 +81,7 @@ struct user{
81 unsigned long magic; /* To uniquely identify a core file */ 81 unsigned long magic; /* To uniquely identify a core file */
82 char u_comm[32]; /* User command that was responsible */ 82 char u_comm[32]; /* User command that was responsible */
83}; 83};
84#define NBPG PAGE_SIZE 84#define NBPG 4096
85#define UPAGES 1 85#define UPAGES 1
86#define HOST_TEXT_START_ADDR (u.start_code) 86#define HOST_TEXT_START_ADDR (u.start_code)
87#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 87#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 495ad99c7635..9ea7f1023e57 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -16,7 +16,7 @@
16#if defined(__s390x__) && defined(MODULE) 16#if defined(__s390x__) && defined(MODULE)
17 17
18#define __reloc_hide(var,offset) (*({ \ 18#define __reloc_hide(var,offset) (*({ \
19 extern int simple_indentifier_##var(void); \ 19 extern int simple_identifier_##var(void); \
20 unsigned long *__ptr; \ 20 unsigned long *__ptr; \
21 asm ( "larl %0,per_cpu__"#var"@GOTENT" \ 21 asm ( "larl %0,per_cpu__"#var"@GOTENT" \
22 : "=a" (__ptr) : "X" (per_cpu__##var) ); \ 22 : "=a" (__ptr) : "X" (per_cpu__##var) ); \
@@ -25,7 +25,7 @@
25#else 25#else
26 26
27#define __reloc_hide(var, offset) (*({ \ 27#define __reloc_hide(var, offset) (*({ \
28 extern int simple_indentifier_##var(void); \ 28 extern int simple_identifier_##var(void); \
29 unsigned long __ptr; \ 29 unsigned long __ptr; \
30 asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \ 30 asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \
31 (typeof(&per_cpu__##var)) (__ptr + (offset)); })) 31 (typeof(&per_cpu__##var)) (__ptr + (offset)); }))
diff --git a/include/asm-um/irq_regs.h b/include/asm-um/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-um/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index 285756010c51..5ed0ef340842 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -32,13 +32,13 @@
32 32
33/* var is in discarded region: offset to particular copy we want */ 33/* var is in discarded region: offset to particular copy we want */
34#define per_cpu(var, cpu) (*({ \ 34#define per_cpu(var, cpu) (*({ \
35 extern int simple_indentifier_##var(void); \ 35 extern int simple_identifier_##var(void); \
36 RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)); })) 36 RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)); }))
37#define __get_cpu_var(var) (*({ \ 37#define __get_cpu_var(var) (*({ \
38 extern int simple_indentifier_##var(void); \ 38 extern int simple_identifier_##var(void); \
39 RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) 39 RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); }))
40#define __raw_get_cpu_var(var) (*({ \ 40#define __raw_get_cpu_var(var) (*({ \
41 extern int simple_indentifier_##var(void); \ 41 extern int simple_identifier_##var(void); \
42 RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); })) 42 RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()); }))
43 43
44/* A macro to avoid #include hell... */ 44/* A macro to avoid #include hell... */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b7966ab8cb6a..26146623be2f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -593,6 +593,7 @@ static inline int page_mapped(struct page *page)
593 */ 593 */
594#define NOPAGE_SIGBUS (NULL) 594#define NOPAGE_SIGBUS (NULL)
595#define NOPAGE_OOM ((struct page *) (-1)) 595#define NOPAGE_OOM ((struct page *) (-1))
596#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */
596 597
597/* 598/*
598 * Error return values for the *_nopfn functions 599 * Error return values for the *_nopfn functions
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 81c3f77f652c..08dec8d9e703 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -83,6 +83,7 @@
83 83
84 /* Application commands */ 84 /* Application commands */
85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ 85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
86#define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
86#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ 87#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
87#define SD_APP_SEND_SCR 51 /* adtc R1 */ 88#define SD_APP_SEND_SCR 51 /* adtc R1 */
88 89
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 46ec72fa2c84..600e3d387ffc 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -19,7 +19,7 @@
19 * we force a syntax error here if it isn't. 19 * we force a syntax error here if it isn't.
20 */ 20 */
21#define get_cpu_var(var) (*({ \ 21#define get_cpu_var(var) (*({ \
22 extern int simple_indentifier_##var(void); \ 22 extern int simple_identifier_##var(void); \
23 preempt_disable(); \ 23 preempt_disable(); \
24 &__get_cpu_var(var); })) 24 &__get_cpu_var(var); }))
25#define put_cpu_var(var) preempt_enable() 25#define put_cpu_var(var) preempt_enable()
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 331f4502e92b..6735c1cf334c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1065,9 +1065,10 @@ static inline int pid_alive(struct task_struct *p)
1065} 1065}
1066 1066
1067/** 1067/**
1068 * is_init - check if a task structure is the first user space 1068 * is_init - check if a task structure is init
1069 * task the kernel created. 1069 * @tsk: Task structure to be checked.
1070 * @p: Task structure to be checked. 1070 *
1071 * Check if a task structure is the first user space task the kernel created.
1071 */ 1072 */
1072static inline int is_init(struct task_struct *tsk) 1073static inline int is_init(struct task_struct *tsk)
1073{ 1074{
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index d6288e89fd9d..9c9a8ad92477 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -57,7 +57,8 @@ struct svc_serv {
57 struct svc_stat * sv_stats; /* RPC statistics */ 57 struct svc_stat * sv_stats; /* RPC statistics */
58 spinlock_t sv_lock; 58 spinlock_t sv_lock;
59 unsigned int sv_nrthreads; /* # of server threads */ 59 unsigned int sv_nrthreads; /* # of server threads */
60 unsigned int sv_bufsz; /* datagram buffer size */ 60 unsigned int sv_max_payload; /* datagram payload size */
61 unsigned int sv_max_mesg; /* max_payload + 1 page for overheads */
61 unsigned int sv_xdrsize; /* XDR buffer size */ 62 unsigned int sv_xdrsize; /* XDR buffer size */
62 63
63 struct list_head sv_permsocks; /* all permanent sockets */ 64 struct list_head sv_permsocks; /* all permanent sockets */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 049dfe4a11f2..db501dc23c29 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -293,6 +293,9 @@ extern void second_overflow(void);
293extern void update_ntp_one_tick(void); 293extern void update_ntp_one_tick(void);
294extern int do_adjtimex(struct timex *); 294extern int do_adjtimex(struct timex *);
295 295
296/* Don't use! Compatibility define for existing users. */
297#define tickadj (500/HZ ? : 1)
298
296#endif /* KERNEL */ 299#endif /* KERNEL */
297 300
298#endif /* LINUX_TIMEX_H */ 301#endif /* LINUX_TIMEX_H */