M
m.selvakannan
hi
iam working with uclinux
i got errors while compilation..
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h: In function 'long unsigned int __cmpxchg(volatile void*,
long unsigned int, long unsigned int)':
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:204: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:213: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:222: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:189: error: expected ',' or '...' before 'new'
source::::::;;;
189static inline unsigned long __cmpxchg(volatile void *ptr,
unsigned long old,unsigned long new, int size)
190 {
191 unsigned long tmp = 0;
192 unsigned long flags = 0;
193
194 local_irq_save(flags);
195
196 switch (size) {
197 case 1:
198 __asm__ __volatile__
199 ("%0 = b%3 (z);\n\t"
200 "CC = %1 == %0;\n\t"
201 "IF !CC JUMP 1f;\n\t"
202 "b%3 = %2;\n\t"
203 "1:\n\t"
204 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
205 break;
206 case 2:
207 __asm__ __volatile__
208 ("%0 = w%3 (z);\n\t"
209 "CC = %1 == %0;\n\t"
210 "IF !CC JUMP 1f;\n\t"
211 "w%3 = %2;\n\t"
212 "1:\n\t"
213 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
214 break;
215 case 4:
216 __asm__ __volatile__
217 ("%0 = %3;\n\t"
218 "CC = %1 == %0;\n\t"
219 "IF !CC JUMP 1f;\n\t"
220 "%3 = %2;\n\t"
221 "1:\n\t"
222 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
223 break;
}
225 local_irq_restore(flags);
226 return tmp;
227 }
help me to solve this
thanks in advance
iam working with uclinux
i got errors while compilation..
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h: In function 'long unsigned int __cmpxchg(volatile void*,
long unsigned int, long unsigned int)':
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:204: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:213: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:222: error: expected type-specifier before ')' token
/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/
system.h:189: error: expected ',' or '...' before 'new'
source::::::;;;
189static inline unsigned long __cmpxchg(volatile void *ptr,
unsigned long old,unsigned long new, int size)
190 {
191 unsigned long tmp = 0;
192 unsigned long flags = 0;
193
194 local_irq_save(flags);
195
196 switch (size) {
197 case 1:
198 __asm__ __volatile__
199 ("%0 = b%3 (z);\n\t"
200 "CC = %1 == %0;\n\t"
201 "IF !CC JUMP 1f;\n\t"
202 "b%3 = %2;\n\t"
203 "1:\n\t"
204 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
205 break;
206 case 2:
207 __asm__ __volatile__
208 ("%0 = w%3 (z);\n\t"
209 "CC = %1 == %0;\n\t"
210 "IF !CC JUMP 1f;\n\t"
211 "w%3 = %2;\n\t"
212 "1:\n\t"
213 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
214 break;
215 case 4:
216 __asm__ __volatile__
217 ("%0 = %3;\n\t"
218 "CC = %1 == %0;\n\t"
219 "IF !CC JUMP 1f;\n\t"
220 "%3 = %2;\n\t"
221 "1:\n\t"
222 : "=&d" (tmp) : "d" (old), "d" (new),
"m" (*__xg(ptr)) : "memory");
223 break;
}
225 local_irq_restore(flags);
226 return tmp;
227 }
help me to solve this
thanks in advance