diff options
Diffstat (limited to 'include/asm-frv')
-rw-r--r-- | include/asm-frv/Kbuild | 1 | ||||
-rw-r--r-- | include/asm-frv/a.out.h | 5 | ||||
-rw-r--r-- | include/asm-frv/atomic.h | 81 | ||||
-rw-r--r-- | include/asm-frv/bitops.h | 83 | ||||
-rw-r--r-- | include/asm-frv/dma-mapping.h | 10 | ||||
-rw-r--r-- | include/asm-frv/elf.h | 2 | ||||
-rw-r--r-- | include/asm-frv/page.h | 9 | ||||
-rw-r--r-- | include/asm-frv/param.h | 2 | ||||
-rw-r--r-- | include/asm-frv/pgalloc.h | 18 | ||||
-rw-r--r-- | include/asm-frv/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-frv/posix_types.h | 8 | ||||
-rw-r--r-- | include/asm-frv/scatterlist.h | 10 | ||||
-rw-r--r-- | include/asm-frv/system.h | 25 | ||||
-rw-r--r-- | include/asm-frv/unistd.h | 2 |
14 files changed, 134 insertions, 124 deletions
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild index 966a9836d556..bc3f12c5b7e0 100644 --- a/include/asm-frv/Kbuild +++ b/include/asm-frv/Kbuild | |||
@@ -4,4 +4,3 @@ header-y += registers.h | |||
4 | 4 | ||
5 | unifdef-y += termios.h | 5 | unifdef-y += termios.h |
6 | unifdef-y += ptrace.h | 6 | unifdef-y += ptrace.h |
7 | unifdef-y += page.h | ||
diff --git a/include/asm-frv/a.out.h b/include/asm-frv/a.out.h deleted file mode 100644 index dd3b7e5754c9..000000000000 --- a/include/asm-frv/a.out.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* | ||
2 | * FRV doesn't do AOUT format. This header file should be removed as | ||
3 | * soon as fs/exec.c and fs/proc/kcore.c and the archs that require | ||
4 | * them to include linux/a.out.h are fixed. | ||
5 | */ | ||
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h index 6ec494a5bc5a..46d696b331e7 100644 --- a/include/asm-frv/atomic.h +++ b/include/asm-frv/atomic.h | |||
@@ -125,87 +125,6 @@ static inline void atomic_dec(atomic_t *v) | |||
125 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) | 125 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) |
126 | #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) | 126 | #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) |
127 | 127 | ||
128 | #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | ||
129 | static inline | ||
130 | unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v) | ||
131 | { | ||
132 | unsigned long old, tmp; | ||
133 | |||
134 | asm volatile( | ||
135 | "0: \n" | ||
136 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
137 | " ckeq icc3,cc7 \n" | ||
138 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
139 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
140 | " and%I3 %1,%3,%2 \n" | ||
141 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
142 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
143 | " beq icc3,#0,0b \n" | ||
144 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
145 | : "NPr"(~mask) | ||
146 | : "memory", "cc7", "cc3", "icc3" | ||
147 | ); | ||
148 | |||
149 | return old; | ||
150 | } | ||
151 | |||
152 | static inline | ||
153 | unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v) | ||
154 | { | ||
155 | unsigned long old, tmp; | ||
156 | |||
157 | asm volatile( | ||
158 | "0: \n" | ||
159 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
160 | " ckeq icc3,cc7 \n" | ||
161 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
162 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
163 | " or%I3 %1,%3,%2 \n" | ||
164 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
165 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
166 | " beq icc3,#0,0b \n" | ||
167 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
168 | : "NPr"(mask) | ||
169 | : "memory", "cc7", "cc3", "icc3" | ||
170 | ); | ||
171 | |||
172 | return old; | ||
173 | } | ||
174 | |||
175 | static inline | ||
176 | unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v) | ||
177 | { | ||
178 | unsigned long old, tmp; | ||
179 | |||
180 | asm volatile( | ||
181 | "0: \n" | ||
182 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
183 | " ckeq icc3,cc7 \n" | ||
184 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
185 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
186 | " xor%I3 %1,%3,%2 \n" | ||
187 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
188 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
189 | " beq icc3,#0,0b \n" | ||
190 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
191 | : "NPr"(mask) | ||
192 | : "memory", "cc7", "cc3", "icc3" | ||
193 | ); | ||
194 | |||
195 | return old; | ||
196 | } | ||
197 | |||
198 | #else | ||
199 | |||
200 | extern unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v); | ||
201 | extern unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v); | ||
202 | extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v); | ||
203 | |||
204 | #endif | ||
205 | |||
206 | #define atomic_clear_mask(mask, v) atomic_test_and_ANDNOT_mask((mask), (v)) | ||
207 | #define atomic_set_mask(mask, v) atomic_test_and_OR_mask((mask), (v)) | ||
208 | |||
209 | /*****************************************************************************/ | 128 | /*****************************************************************************/ |
210 | /* | 129 | /* |
211 | * exchange value with memory | 130 | * exchange value with memory |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 5f86b876b298..39456ba0ec17 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <asm/byteorder.h> | 18 | #include <asm/byteorder.h> |
19 | #include <asm/system.h> | ||
20 | #include <asm/atomic.h> | ||
21 | 19 | ||
22 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
23 | 21 | ||
@@ -33,6 +31,87 @@ | |||
33 | #define smp_mb__before_clear_bit() barrier() | 31 | #define smp_mb__before_clear_bit() barrier() |
34 | #define smp_mb__after_clear_bit() barrier() | 32 | #define smp_mb__after_clear_bit() barrier() |
35 | 33 | ||
34 | #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | ||
35 | static inline | ||
36 | unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v) | ||
37 | { | ||
38 | unsigned long old, tmp; | ||
39 | |||
40 | asm volatile( | ||
41 | "0: \n" | ||
42 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
43 | " ckeq icc3,cc7 \n" | ||
44 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
45 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
46 | " and%I3 %1,%3,%2 \n" | ||
47 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
48 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
49 | " beq icc3,#0,0b \n" | ||
50 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
51 | : "NPr"(~mask) | ||
52 | : "memory", "cc7", "cc3", "icc3" | ||
53 | ); | ||
54 | |||
55 | return old; | ||
56 | } | ||
57 | |||
58 | static inline | ||
59 | unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v) | ||
60 | { | ||
61 | unsigned long old, tmp; | ||
62 | |||
63 | asm volatile( | ||
64 | "0: \n" | ||
65 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
66 | " ckeq icc3,cc7 \n" | ||
67 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
68 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
69 | " or%I3 %1,%3,%2 \n" | ||
70 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
71 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
72 | " beq icc3,#0,0b \n" | ||
73 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
74 | : "NPr"(mask) | ||
75 | : "memory", "cc7", "cc3", "icc3" | ||
76 | ); | ||
77 | |||
78 | return old; | ||
79 | } | ||
80 | |||
81 | static inline | ||
82 | unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v) | ||
83 | { | ||
84 | unsigned long old, tmp; | ||
85 | |||
86 | asm volatile( | ||
87 | "0: \n" | ||
88 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
89 | " ckeq icc3,cc7 \n" | ||
90 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
91 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
92 | " xor%I3 %1,%3,%2 \n" | ||
93 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
94 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
95 | " beq icc3,#0,0b \n" | ||
96 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
97 | : "NPr"(mask) | ||
98 | : "memory", "cc7", "cc3", "icc3" | ||
99 | ); | ||
100 | |||
101 | return old; | ||
102 | } | ||
103 | |||
104 | #else | ||
105 | |||
106 | extern unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v); | ||
107 | extern unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v); | ||
108 | extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v); | ||
109 | |||
110 | #endif | ||
111 | |||
112 | #define atomic_clear_mask(mask, v) atomic_test_and_ANDNOT_mask((mask), (v)) | ||
113 | #define atomic_set_mask(mask, v) atomic_test_and_OR_mask((mask), (v)) | ||
114 | |||
36 | static inline int test_and_clear_bit(int nr, volatile void *addr) | 115 | static inline int test_and_clear_bit(int nr, volatile void *addr) |
37 | { | 116 | { |
38 | volatile unsigned long *ptr = addr; | 117 | volatile unsigned long *ptr = addr; |
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h index bcb2df68496e..2e8966ca030d 100644 --- a/include/asm-frv/dma-mapping.h +++ b/include/asm-frv/dma-mapping.h | |||
@@ -17,16 +17,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle | |||
17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); | 17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * These macros should be used after a pci_map_sg call has been done | ||
21 | * to get bus addresses of each of the SG entries and their lengths. | ||
22 | * You should only work with the number of sg entries pci_map_sg | ||
23 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
24 | * is 0. | ||
25 | */ | ||
26 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
27 | #define sg_dma_len(sg) ((sg)->length) | ||
28 | |||
29 | /* | ||
30 | * Map a single buffer of the indicated size for DMA in streaming mode. | 20 | * Map a single buffer of the indicated size for DMA in streaming mode. |
31 | * The 32-bit bus address to use is returned. | 21 | * The 32-bit bus address to use is returned. |
32 | * | 22 | * |
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h index 7df58a3e6e4a..9fb946bb7dc9 100644 --- a/include/asm-frv/elf.h +++ b/include/asm-frv/elf.h | |||
@@ -137,8 +137,6 @@ do { \ | |||
137 | 137 | ||
138 | #define ELF_PLATFORM (NULL) | 138 | #define ELF_PLATFORM (NULL) |
139 | 139 | ||
140 | #ifdef __KERNEL__ | ||
141 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | 140 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) |
142 | #endif | ||
143 | 141 | ||
144 | #endif | 142 | #endif |
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index 213d92fd652a..c2c1e89e747d 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_PAGE_H | 1 | #ifndef _ASM_PAGE_H |
2 | #define _ASM_PAGE_H | 2 | #define _ASM_PAGE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <asm/virtconvert.h> | 4 | #include <asm/virtconvert.h> |
7 | #include <asm/mem-layout.h> | 5 | #include <asm/mem-layout.h> |
8 | #include <asm/sections.h> | 6 | #include <asm/sections.h> |
@@ -27,6 +25,7 @@ typedef struct { unsigned long ste[64];} pmd_t; | |||
27 | typedef struct { pmd_t pue[1]; } pud_t; | 25 | typedef struct { pmd_t pue[1]; } pud_t; |
28 | typedef struct { pud_t pge[1]; } pgd_t; | 26 | typedef struct { pud_t pge[1]; } pgd_t; |
29 | typedef struct { unsigned long pgprot; } pgprot_t; | 27 | typedef struct { unsigned long pgprot; } pgprot_t; |
28 | typedef struct page *pgtable_t; | ||
30 | 29 | ||
31 | #define pte_val(x) ((x).pte) | 30 | #define pte_val(x) ((x).pte) |
32 | #define pmd_val(x) ((x).ste[0]) | 31 | #define pmd_val(x) ((x).ste[0]) |
@@ -76,13 +75,7 @@ extern unsigned long max_pfn; | |||
76 | 75 | ||
77 | #endif /* __ASSEMBLY__ */ | 76 | #endif /* __ASSEMBLY__ */ |
78 | 77 | ||
79 | #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC | ||
80 | #define WANT_PAGE_VIRTUAL 1 | ||
81 | #endif | ||
82 | |||
83 | #include <asm-generic/memory_model.h> | 78 | #include <asm-generic/memory_model.h> |
84 | #include <asm-generic/page.h> | 79 | #include <asm-generic/page.h> |
85 | 80 | ||
86 | #endif /* __KERNEL__ */ | ||
87 | |||
88 | #endif /* _ASM_PAGE_H */ | 81 | #endif /* _ASM_PAGE_H */ |
diff --git a/include/asm-frv/param.h b/include/asm-frv/param.h index 365653b1726c..6859dd503ed3 100644 --- a/include/asm-frv/param.h +++ b/include/asm-frv/param.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_PARAM_H | 2 | #define _ASM_PARAM_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #define HZ 1000 /* Internal kernel timer frequency */ | 5 | #define HZ CONFIG_HZ /* Internal kernel timer frequency */ |
6 | #define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | 6 | #define USER_HZ 100 /* .. some user interfaces are in "ticks" */ |
7 | #define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | 7 | #define CLOCKS_PER_SEC (USER_HZ) /* like times() */ |
8 | #endif | 8 | #endif |
diff --git a/include/asm-frv/pgalloc.h b/include/asm-frv/pgalloc.h index ce982a6c610f..971e6addb009 100644 --- a/include/asm-frv/pgalloc.h +++ b/include/asm-frv/pgalloc.h | |||
@@ -25,29 +25,35 @@ | |||
25 | do { \ | 25 | do { \ |
26 | __set_pmd((PMD), page_to_pfn(PAGE) << PAGE_SHIFT | _PAGE_TABLE); \ | 26 | __set_pmd((PMD), page_to_pfn(PAGE) << PAGE_SHIFT | _PAGE_TABLE); \ |
27 | } while(0) | 27 | } while(0) |
28 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Allocate and free page tables. | 31 | * Allocate and free page tables. |
31 | */ | 32 | */ |
32 | 33 | ||
33 | extern pgd_t *pgd_alloc(struct mm_struct *); | 34 | extern pgd_t *pgd_alloc(struct mm_struct *); |
34 | extern void pgd_free(pgd_t *); | 35 | extern void pgd_free(struct mm_struct *mm, pgd_t *); |
35 | 36 | ||
36 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); | 37 | extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); |
37 | 38 | ||
38 | extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); | 39 | extern pgtable_t pte_alloc_one(struct mm_struct *, unsigned long); |
39 | 40 | ||
40 | static inline void pte_free_kernel(pte_t *pte) | 41 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
41 | { | 42 | { |
42 | free_page((unsigned long)pte); | 43 | free_page((unsigned long)pte); |
43 | } | 44 | } |
44 | 45 | ||
45 | static inline void pte_free(struct page *pte) | 46 | static inline void pte_free(struct mm_struct *mm, pgtable_t pte) |
46 | { | 47 | { |
48 | pgtable_page_dtor(pte); | ||
47 | __free_page(pte); | 49 | __free_page(pte); |
48 | } | 50 | } |
49 | 51 | ||
50 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | 52 | #define __pte_free_tlb(tlb,pte) \ |
53 | do { \ | ||
54 | pgtable_page_dtor(pte); \ | ||
55 | tlb_remove_page((tlb),(pte)); \ | ||
56 | } while (0) | ||
51 | 57 | ||
52 | /* | 58 | /* |
53 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 59 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
@@ -55,7 +61,7 @@ static inline void pte_free(struct page *pte) | |||
55 | * (In the PAE case we free the pmds as part of the pgd.) | 61 | * (In the PAE case we free the pmds as part of the pgd.) |
56 | */ | 62 | */ |
57 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) | 63 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) |
58 | #define pmd_free(x) do { } while (0) | 64 | #define pmd_free(mm, x) do { } while (0) |
59 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 65 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
60 | 66 | ||
61 | #endif /* CONFIG_MMU */ | 67 | #endif /* CONFIG_MMU */ |
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index 3c402afb9e74..6c0682ed5fc9 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -226,7 +226,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) | |||
226 | * inside the pgd, so has no extra memory associated with it. | 226 | * inside the pgd, so has no extra memory associated with it. |
227 | */ | 227 | */ |
228 | #define pud_alloc_one(mm, address) NULL | 228 | #define pud_alloc_one(mm, address) NULL |
229 | #define pud_free(x) do { } while (0) | 229 | #define pud_free(mm, x) do { } while (0) |
230 | #define __pud_free_tlb(tlb, x) do { } while (0) | 230 | #define __pud_free_tlb(tlb, x) do { } while (0) |
231 | 231 | ||
232 | /* | 232 | /* |
diff --git a/include/asm-frv/posix_types.h b/include/asm-frv/posix_types.h index 73c2ba8d76b4..a9f1f5be0632 100644 --- a/include/asm-frv/posix_types.h +++ b/include/asm-frv/posix_types.h | |||
@@ -39,14 +39,10 @@ typedef long long __kernel_loff_t; | |||
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | typedef struct { | 41 | typedef struct { |
42 | #if defined(__KERNEL__) || defined(__USE_ALL) | ||
43 | int val[2]; | 42 | int val[2]; |
44 | #else /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
45 | int __val[2]; | ||
46 | #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
47 | } __kernel_fsid_t; | 43 | } __kernel_fsid_t; |
48 | 44 | ||
49 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | 45 | #if defined(__KERNEL__) |
50 | 46 | ||
51 | #undef __FD_SET | 47 | #undef __FD_SET |
52 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | 48 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) |
@@ -60,7 +56,7 @@ typedef struct { | |||
60 | #undef __FD_ZERO | 56 | #undef __FD_ZERO |
61 | #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) | 57 | #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) |
62 | 58 | ||
63 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | 59 | #endif /* defined(__KERNEL__) */ |
64 | 60 | ||
65 | #endif | 61 | #endif |
66 | 62 | ||
diff --git a/include/asm-frv/scatterlist.h b/include/asm-frv/scatterlist.h index 2e7143b5a7ad..4bca8a28546c 100644 --- a/include/asm-frv/scatterlist.h +++ b/include/asm-frv/scatterlist.h | |||
@@ -31,6 +31,16 @@ struct scatterlist { | |||
31 | unsigned int length; | 31 | unsigned int length; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | /* | ||
35 | * These macros should be used after a pci_map_sg call has been done | ||
36 | * to get bus addresses of each of the SG entries and their lengths. | ||
37 | * You should only work with the number of sg entries pci_map_sg | ||
38 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
39 | * is 0. | ||
40 | */ | ||
41 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
42 | #define sg_dma_len(sg) ((sg)->length) | ||
43 | |||
34 | #define ISA_DMA_THRESHOLD (0xffffffffUL) | 44 | #define ISA_DMA_THRESHOLD (0xffffffffUL) |
35 | 45 | ||
36 | #endif /* !_ASM_SCATTERLIST_H */ | 46 | #endif /* !_ASM_SCATTERLIST_H */ |
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 9f5663ba19f8..b400cea81487 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <linux/kernel.h> | ||
17 | 18 | ||
18 | struct thread_struct; | 19 | struct thread_struct; |
19 | 20 | ||
@@ -268,5 +269,29 @@ extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new); | |||
268 | 269 | ||
269 | #endif | 270 | #endif |
270 | 271 | ||
272 | #include <asm-generic/cmpxchg-local.h> | ||
273 | |||
274 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
275 | unsigned long old, | ||
276 | unsigned long new, int size) | ||
277 | { | ||
278 | switch (size) { | ||
279 | case 4: | ||
280 | return cmpxchg((unsigned long *)ptr, old, new); | ||
281 | default: | ||
282 | return __cmpxchg_local_generic(ptr, old, new, size); | ||
283 | } | ||
284 | |||
285 | return old; | ||
286 | } | ||
287 | |||
288 | /* | ||
289 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
290 | * them available. | ||
291 | */ | ||
292 | #define cmpxchg_local(ptr, o, n) \ | ||
293 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
294 | (unsigned long)(n), sizeof(*(ptr)))) | ||
295 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
271 | 296 | ||
272 | #endif /* _ASM_SYSTEM_H */ | 297 | #endif /* _ASM_SYSTEM_H */ |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index cd84f1771e34..e8c986667532 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -328,7 +328,7 @@ | |||
328 | #define __NR_epoll_pwait 319 | 328 | #define __NR_epoll_pwait 319 |
329 | #define __NR_utimensat 320 | 329 | #define __NR_utimensat 320 |
330 | #define __NR_signalfd 321 | 330 | #define __NR_signalfd 321 |
331 | #define __NR_timerfd 322 | 331 | /* #define __NR_timerfd 322 removed */ |
332 | #define __NR_eventfd 323 | 332 | #define __NR_eventfd 323 |
333 | #define __NR_fallocate 324 | 333 | #define __NR_fallocate 324 |
334 | 334 | ||