[ECOS] Bug in declaration of Cyg_Scheduler::unlock_inner ?

Nick Garnett nickg@ecoscentric.com
Tue Oct 28 13:02:00 GMT 2003


"Uwe Kindler" <ukindler@htwm.de> writes:

> Hello,
> 
> I buildet eCos for the EDOSK board with the default configuration and
> received the following error message:
> 
> make: Leaving directory `/ecos-d/ecos/workdir/default_edosk_build'
>    Cyg_Scheduler::unlock_inner(unsigned int)' does not match any in class `
>    Cyg_Scheduler'
> /ecos-d/ecos/workdir/default_edosk_install/include/cyg/kernel/sched.hxx:155:
> candidate
>     is: static void Cyg_Scheduler::unlock_inner(long unsigned int = 0)
> make[1]: *** [src/sched/sched.o.d] Error 1
> make: *** [build] Error 2
> 
> 
> In sched.hxx then unlock_inner is declared as:
> 
> static void             unlock_inner(cyg_uint32 new_lock = 0);
> 
> In sched.cxx then unlock_inner is defined as:
> 
> void Cyg_Scheduler::unlock_inner( cyg_ucount32 new_lock )
> 
> In basetype.h I defined  #define cyg_halint32   long and did not define
> cyg_halcount32 so it was
> defined as int by default in cyg_type.h.
> Now I also defined cyg_halcount32 as long and there is no problem anymore.
> So my two questions are:
> 
> 1. What is the reason for the different declaration of  unlock_inner.

It's a bug. The declaration in sched.hxx should be cyg_ucount32. I'll
check in a fix for it.

> 
> 2. If int is 32 bits wide should I use long or int for cyg_halint32 - o
> doesn't it matter.

Unless there is a *very* good reason to change it then the default type
declarations in cyg_type.h should be used.

> 
> 2. Why is cyg_halcount8, cyg_halcount16 and cyg_halcount32 defined as int by
> default?

The "count" types are meant to be types that can contain at least the
given number of bits, and which are most efficiently handled by the
CPU. For most CPUs this is the natural register size, which is usually
what int maps on to. They correspond to the "fast" types in the C99
standard.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list