error while compilation

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
 
M

Mark Bluemel

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 }

The code with issues is not actually C, as far as I can see. This
newsgroup is about C not assembler.

You'd probably do better asking in a group or forum which is related to
the compiler (I presume it's gcc, so gnu.gcc or gnu.gcc.help may be
appropriate) or the software you're trying to build
(http://www.uclinux.org/maillist/ may be helpful).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top