diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-26 01:08:05 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-26 01:08:05 -0400 |
commit | ccd7bc2f67fdfa9c47ceae64f1117d1fb6cb8737 (patch) | |
tree | 33b13cd5582c419f8ae098edb24ca355974a7ccf /include | |
parent | 6f0ef4fa57b9ba27d7b1c330bad041f1665501fe (diff) | |
parent | 6693e74a16ef563960764bd963f1048392135c3c (diff) |
Merge branch 'master'
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/atomic.h | 14 | ||||
-rw-r--r-- | include/asm-alpha/barrier.h | 34 | ||||
-rw-r--r-- | include/asm-alpha/system.h | 31 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/regs-clock.h | 21 | ||||
-rw-r--r-- | include/linux/hugetlb.h | 16 | ||||
-rw-r--r-- | include/linux/idr.h | 1 | ||||
-rw-r--r-- | include/net/ax25.h | 2 | ||||
-rw-r--r-- | include/net/llc_pdu.h | 4 |
8 files changed, 70 insertions, 53 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 1b383e3cb68c..20ac3d95ecd9 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ALPHA_ATOMIC_H | 1 | #ifndef _ALPHA_ATOMIC_H |
2 | #define _ALPHA_ATOMIC_H | 2 | #define _ALPHA_ATOMIC_H |
3 | 3 | ||
4 | #include <asm/barrier.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * Atomic operations that C can't guarantee us. Useful for | 7 | * Atomic operations that C can't guarantee us. Useful for |
6 | * resource counting etc... | 8 | * resource counting etc... |
@@ -100,18 +102,19 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
100 | static __inline__ long atomic_add_return(int i, atomic_t * v) | 102 | static __inline__ long atomic_add_return(int i, atomic_t * v) |
101 | { | 103 | { |
102 | long temp, result; | 104 | long temp, result; |
105 | smp_mb(); | ||
103 | __asm__ __volatile__( | 106 | __asm__ __volatile__( |
104 | "1: ldl_l %0,%1\n" | 107 | "1: ldl_l %0,%1\n" |
105 | " addl %0,%3,%2\n" | 108 | " addl %0,%3,%2\n" |
106 | " addl %0,%3,%0\n" | 109 | " addl %0,%3,%0\n" |
107 | " stl_c %0,%1\n" | 110 | " stl_c %0,%1\n" |
108 | " beq %0,2f\n" | 111 | " beq %0,2f\n" |
109 | " mb\n" | ||
110 | ".subsection 2\n" | 112 | ".subsection 2\n" |
111 | "2: br 1b\n" | 113 | "2: br 1b\n" |
112 | ".previous" | 114 | ".previous" |
113 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 115 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
114 | :"Ir" (i), "m" (v->counter) : "memory"); | 116 | :"Ir" (i), "m" (v->counter) : "memory"); |
117 | smp_mb(); | ||
115 | return result; | 118 | return result; |
116 | } | 119 | } |
117 | 120 | ||
@@ -120,54 +123,57 @@ static __inline__ long atomic_add_return(int i, atomic_t * v) | |||
120 | static __inline__ long atomic64_add_return(long i, atomic64_t * v) | 123 | static __inline__ long atomic64_add_return(long i, atomic64_t * v) |
121 | { | 124 | { |
122 | long temp, result; | 125 | long temp, result; |
126 | smp_mb(); | ||
123 | __asm__ __volatile__( | 127 | __asm__ __volatile__( |
124 | "1: ldq_l %0,%1\n" | 128 | "1: ldq_l %0,%1\n" |
125 | " addq %0,%3,%2\n" | 129 | " addq %0,%3,%2\n" |
126 | " addq %0,%3,%0\n" | 130 | " addq %0,%3,%0\n" |
127 | " stq_c %0,%1\n" | 131 | " stq_c %0,%1\n" |
128 | " beq %0,2f\n" | 132 | " beq %0,2f\n" |
129 | " mb\n" | ||
130 | ".subsection 2\n" | 133 | ".subsection 2\n" |
131 | "2: br 1b\n" | 134 | "2: br 1b\n" |
132 | ".previous" | 135 | ".previous" |
133 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 136 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
134 | :"Ir" (i), "m" (v->counter) : "memory"); | 137 | :"Ir" (i), "m" (v->counter) : "memory"); |
138 | smp_mb(); | ||
135 | return result; | 139 | return result; |
136 | } | 140 | } |
137 | 141 | ||
138 | static __inline__ long atomic_sub_return(int i, atomic_t * v) | 142 | static __inline__ long atomic_sub_return(int i, atomic_t * v) |
139 | { | 143 | { |
140 | long temp, result; | 144 | long temp, result; |
145 | smp_mb(); | ||
141 | __asm__ __volatile__( | 146 | __asm__ __volatile__( |
142 | "1: ldl_l %0,%1\n" | 147 | "1: ldl_l %0,%1\n" |
143 | " subl %0,%3,%2\n" | 148 | " subl %0,%3,%2\n" |
144 | " subl %0,%3,%0\n" | 149 | " subl %0,%3,%0\n" |
145 | " stl_c %0,%1\n" | 150 | " stl_c %0,%1\n" |
146 | " beq %0,2f\n" | 151 | " beq %0,2f\n" |
147 | " mb\n" | ||
148 | ".subsection 2\n" | 152 | ".subsection 2\n" |
149 | "2: br 1b\n" | 153 | "2: br 1b\n" |
150 | ".previous" | 154 | ".previous" |
151 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 155 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
152 | :"Ir" (i), "m" (v->counter) : "memory"); | 156 | :"Ir" (i), "m" (v->counter) : "memory"); |
157 | smp_mb(); | ||
153 | return result; | 158 | return result; |
154 | } | 159 | } |
155 | 160 | ||
156 | static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | 161 | static __inline__ long atomic64_sub_return(long i, atomic64_t * v) |
157 | { | 162 | { |
158 | long temp, result; | 163 | long temp, result; |
164 | smp_mb(); | ||
159 | __asm__ __volatile__( | 165 | __asm__ __volatile__( |
160 | "1: ldq_l %0,%1\n" | 166 | "1: ldq_l %0,%1\n" |
161 | " subq %0,%3,%2\n" | 167 | " subq %0,%3,%2\n" |
162 | " subq %0,%3,%0\n" | 168 | " subq %0,%3,%0\n" |
163 | " stq_c %0,%1\n" | 169 | " stq_c %0,%1\n" |
164 | " beq %0,2f\n" | 170 | " beq %0,2f\n" |
165 | " mb\n" | ||
166 | ".subsection 2\n" | 171 | ".subsection 2\n" |
167 | "2: br 1b\n" | 172 | "2: br 1b\n" |
168 | ".previous" | 173 | ".previous" |
169 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 174 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
170 | :"Ir" (i), "m" (v->counter) : "memory"); | 175 | :"Ir" (i), "m" (v->counter) : "memory"); |
176 | smp_mb(); | ||
171 | return result; | 177 | return result; |
172 | } | 178 | } |
173 | 179 | ||
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h new file mode 100644 index 000000000000..229c83fe77cb --- /dev/null +++ b/include/asm-alpha/barrier.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef __BARRIER_H | ||
2 | #define __BARRIER_H | ||
3 | |||
4 | #define mb() \ | ||
5 | __asm__ __volatile__("mb": : :"memory") | ||
6 | |||
7 | #define rmb() \ | ||
8 | __asm__ __volatile__("mb": : :"memory") | ||
9 | |||
10 | #define wmb() \ | ||
11 | __asm__ __volatile__("wmb": : :"memory") | ||
12 | |||
13 | #define read_barrier_depends() \ | ||
14 | __asm__ __volatile__("mb": : :"memory") | ||
15 | |||
16 | #ifdef CONFIG_SMP | ||
17 | #define smp_mb() mb() | ||
18 | #define smp_rmb() rmb() | ||
19 | #define smp_wmb() wmb() | ||
20 | #define smp_read_barrier_depends() read_barrier_depends() | ||
21 | #else | ||
22 | #define smp_mb() barrier() | ||
23 | #define smp_rmb() barrier() | ||
24 | #define smp_wmb() barrier() | ||
25 | #define smp_read_barrier_depends() barrier() | ||
26 | #endif | ||
27 | |||
28 | #define set_mb(var, value) \ | ||
29 | do { var = value; mb(); } while (0) | ||
30 | |||
31 | #define set_wmb(var, value) \ | ||
32 | do { var = value; wmb(); } while (0) | ||
33 | |||
34 | #endif /* __BARRIER_H */ | ||
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index bdb4d66418f1..050e86d12891 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/pal.h> | 5 | #include <asm/pal.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <asm/barrier.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * System defines.. Note that this is included both from .c and .S | 10 | * System defines.. Note that this is included both from .c and .S |
@@ -139,36 +140,6 @@ extern void halt(void) __attribute__((noreturn)); | |||
139 | struct task_struct; | 140 | struct task_struct; |
140 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); | 141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); |
141 | 142 | ||
142 | #define mb() \ | ||
143 | __asm__ __volatile__("mb": : :"memory") | ||
144 | |||
145 | #define rmb() \ | ||
146 | __asm__ __volatile__("mb": : :"memory") | ||
147 | |||
148 | #define wmb() \ | ||
149 | __asm__ __volatile__("wmb": : :"memory") | ||
150 | |||
151 | #define read_barrier_depends() \ | ||
152 | __asm__ __volatile__("mb": : :"memory") | ||
153 | |||
154 | #ifdef CONFIG_SMP | ||
155 | #define smp_mb() mb() | ||
156 | #define smp_rmb() rmb() | ||
157 | #define smp_wmb() wmb() | ||
158 | #define smp_read_barrier_depends() read_barrier_depends() | ||
159 | #else | ||
160 | #define smp_mb() barrier() | ||
161 | #define smp_rmb() barrier() | ||
162 | #define smp_wmb() barrier() | ||
163 | #define smp_read_barrier_depends() barrier() | ||
164 | #endif | ||
165 | |||
166 | #define set_mb(var, value) \ | ||
167 | do { var = value; mb(); } while (0) | ||
168 | |||
169 | #define set_wmb(var, value) \ | ||
170 | do { var = value; wmb(); } while (0) | ||
171 | |||
172 | #define imb() \ | 143 | #define imb() \ |
173 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") | 144 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") |
174 | 145 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index 16f4c3cc1388..34360706e016 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
@@ -18,7 +18,9 @@ | |||
18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) | 18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) |
19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA | 19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA |
20 | * 27-Aug-2005 Ben Dooks Add clock-slow info | 20 | * 27-Aug-2005 Ben Dooks Add clock-slow info |
21 | */ | 21 | * 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat) |
22 | * 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat) | ||
23 | */ | ||
22 | 24 | ||
23 | #ifndef __ASM_ARM_REGS_CLOCK | 25 | #ifndef __ASM_ARM_REGS_CLOCK |
24 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" | 26 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" |
@@ -66,11 +68,16 @@ | |||
66 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) | 68 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) |
67 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) | 69 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) |
68 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) | 70 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) |
71 | #define S3C2410_DCLKCON_DCLK0_DIV_MASK ((0xf)<<4) | ||
72 | #define S3C2410_DCLKCON_DCLK0_CMP_MASK ((0xf)<<8) | ||
69 | 73 | ||
70 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) | 74 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) |
71 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) | 75 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) |
72 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) | 76 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) |
73 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) | 77 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) |
78 | #define S3C2410_DCLKCON_DCLK1_CMP(x) (((x) - 1) <<24) | ||
79 | #define S3C2410_DCLKCON_DCLK1_DIV_MASK ((0xf) <<20) | ||
80 | #define S3C2410_DCLKCON_DCLK1_CMP_MASK ((0xf) <<24) | ||
74 | 81 | ||
75 | #define S3C2410_CLKDIVN_PDIVN (1<<0) | 82 | #define S3C2410_CLKDIVN_PDIVN (1<<0) |
76 | #define S3C2410_CLKDIVN_HDIVN (1<<1) | 83 | #define S3C2410_CLKDIVN_HDIVN (1<<1) |
@@ -83,10 +90,13 @@ | |||
83 | 90 | ||
84 | #ifndef __ASSEMBLY__ | 91 | #ifndef __ASSEMBLY__ |
85 | 92 | ||
93 | #include <asm/div64.h> | ||
94 | |||
86 | static inline unsigned int | 95 | static inline unsigned int |
87 | s3c2410_get_pll(int pllval, int baseclk) | 96 | s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) |
88 | { | 97 | { |
89 | int mdiv, pdiv, sdiv; | 98 | unsigned int mdiv, pdiv, sdiv; |
99 | uint64_t fvco; | ||
90 | 100 | ||
91 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; | 101 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; |
92 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; | 102 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; |
@@ -96,7 +106,10 @@ s3c2410_get_pll(int pllval, int baseclk) | |||
96 | pdiv &= S3C2410_PLLCON_PDIVMASK; | 106 | pdiv &= S3C2410_PLLCON_PDIVMASK; |
97 | sdiv &= S3C2410_PLLCON_SDIVMASK; | 107 | sdiv &= S3C2410_PLLCON_SDIVMASK; |
98 | 108 | ||
99 | return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv); | 109 | fvco = (uint64_t)baseclk * (mdiv + 8); |
110 | do_div(fvco, (pdiv + 2) << sdiv); | ||
111 | |||
112 | return (unsigned int)fvco; | ||
100 | } | 113 | } |
101 | 114 | ||
102 | #endif /* __ASSEMBLY__ */ | 115 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 42cb7d70f9ac..d664330d900e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t); | |||
25 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
26 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
27 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
28 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | ||
29 | unsigned long address, int write_access); | ||
28 | 30 | ||
29 | extern unsigned long max_huge_pages; | 31 | extern unsigned long max_huge_pages; |
30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void) | |||
99 | do { } while (0) | 101 | do { } while (0) |
100 | #define alloc_huge_page() ({ NULL; }) | 102 | #define alloc_huge_page() ({ NULL; }) |
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | 103 | #define free_huge_page(p) ({ (void)(p); BUG(); }) |
104 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | ||
102 | 105 | ||
103 | #ifndef HPAGE_MASK | 106 | #ifndef HPAGE_MASK |
104 | #define HPAGE_MASK 0 /* Keep the compiler happy */ | 107 | #define HPAGE_MASK 0 /* Keep the compiler happy */ |
@@ -155,24 +158,11 @@ static inline void set_file_hugepages(struct file *file) | |||
155 | { | 158 | { |
156 | file->f_op = &hugetlbfs_file_operations; | 159 | file->f_op = &hugetlbfs_file_operations; |
157 | } | 160 | } |
158 | |||
159 | static inline int valid_hugetlb_file_off(struct vm_area_struct *vma, | ||
160 | unsigned long address) | ||
161 | { | ||
162 | struct inode *inode = vma->vm_file->f_dentry->d_inode; | ||
163 | loff_t file_off = address - vma->vm_start; | ||
164 | |||
165 | file_off += (vma->vm_pgoff << PAGE_SHIFT); | ||
166 | |||
167 | return (file_off < inode->i_size); | ||
168 | } | ||
169 | |||
170 | #else /* !CONFIG_HUGETLBFS */ | 161 | #else /* !CONFIG_HUGETLBFS */ |
171 | 162 | ||
172 | #define is_file_hugepages(file) 0 | 163 | #define is_file_hugepages(file) 0 |
173 | #define set_file_hugepages(file) BUG() | 164 | #define set_file_hugepages(file) BUG() |
174 | #define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) | 165 | #define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) |
175 | #define valid_hugetlb_file_off(vma, address) 0 | ||
176 | 166 | ||
177 | #endif /* !CONFIG_HUGETLBFS */ | 167 | #endif /* !CONFIG_HUGETLBFS */ |
178 | 168 | ||
diff --git a/include/linux/idr.h b/include/linux/idr.h index ca3b7e462576..3d5de45f961b 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -75,4 +75,5 @@ int idr_pre_get(struct idr *idp, unsigned gfp_mask); | |||
75 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 75 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
77 | void idr_remove(struct idr *idp, int id); | 77 | void idr_remove(struct idr *idp, int id); |
78 | void idr_destroy(struct idr *idp); | ||
78 | void idr_init(struct idr *idp); | 79 | void idr_init(struct idr *idp); |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 9dbcd9e51c00..30bb4a893237 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -171,7 +171,7 @@ typedef struct { | |||
171 | ax25_address calls[AX25_MAX_DIGIS]; | 171 | ax25_address calls[AX25_MAX_DIGIS]; |
172 | unsigned char repeated[AX25_MAX_DIGIS]; | 172 | unsigned char repeated[AX25_MAX_DIGIS]; |
173 | unsigned char ndigi; | 173 | unsigned char ndigi; |
174 | char lastrepeat; | 174 | signed char lastrepeat; |
175 | } ax25_digi; | 175 | } ax25_digi; |
176 | 176 | ||
177 | typedef struct ax25_route { | 177 | typedef struct ax25_route { |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index f45c37d89cf7..c7a959428b4f 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -254,8 +254,10 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | |||
254 | { | 254 | { |
255 | if (skb->protocol == ntohs(ETH_P_802_2)) | 255 | if (skb->protocol == ntohs(ETH_P_802_2)) |
256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); | 256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); |
257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) | 257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) { |
258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); | 258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); |
259 | *sa &= 0x7F; | ||
260 | } | ||
259 | } | 261 | } |
260 | 262 | ||
261 | /** | 263 | /** |