[Click] error when compile click with kernel2.4.20

zhengchuanbo zhengcb at netpower.com.cn
Mon Jul 14 16:23:21 EDT 2003


i patched the source. this time i got the following errors,both in click-1.3pre1 and the cvs version. 
./elements/linuxmodule/todevice.cc: In method `bool ToDevice::run_task()':
./elements/linuxmodule/todevice.cc:180: inconsistent operand constraints in an `asm'
./elements/linuxmodule/todevice.cc:281: inconsistent operand constraints in an `asm'

the code in todevice.cc is as follows,
	#if LINUX_VERSION_CODE >= 0x020400
  local_bh_disable();
  if (!spin_trylock(&_dev->xmit_lock)) {
    local_bh_enable();
    _task.fast_reschedule();
    return false;
 
it is "local_bh_enable()" which cause the problem. in softirq.h i found the definition of local_bh_enable(),
	
/*
 * NOTE: this assembly code assumes:
 *
 *    (char *)&local_bh_count - 8 == (char *)&softirq_pending
 *
 * If you change the offsets in irq_stat then you have to
 * update this code as well.
 */
#define local_bh_enable()                 \
do {                          \
   unsigned int *ptr = &local_bh_count(smp_processor_id()); \
                           \
   barrier();                    \
   if (!--*ptr)                     \
      __asm__ __volatile__ (              \
         "cmpl $0, -8(%0);"            \
         "jnz 2f;"               \
         "1:;"                \
                           \
         LOCK_SECTION_START("")           \
         "2: pushl %%eax; pushl %%ecx; pushl %%edx;"  \
         "call %c1;"             \
         "popl %%edx; popl %%ecx; popl %%eax;"     \
         "jmp 1b;"               \
         LOCK_SECTION_END           \
                           \
      : /* no output */             \
      : "r" (ptr), "i" (do_softirq)          \
      /* no registers clobbered */ );           \
} while (0)

#endif   /* __ASM_SOFTIRQ_H */	

i don't know what cause the problem. 

chuanbo zheng
zhengcb at netpower.com.cn
	
	
>Hi,
>
>>                  from ../include/click/straccum.hh:4,
>>                  from ../lib/string.cc:21:
>> /usr/src/linux/include/asm/spinlock.h:188: parse error before `::'
>> /usr/src/linux/include/asm/spinlock.h:189: confused by earlier errors, bailing out
>
>Did you patch the linux-2.4.20 source with our patch? It doesn't look like
>it.
>
>This error also needs to be taken care of:
>
>> g++: @DEPCFLAGS@: No such file or directory
>
>Are you using the anonymous CVS sources? Could you try those, if you
>aren't?
>
>Eddie






More information about the click mailing list