This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question CYGNUM_KERNEL_THREADS_DATA_MAX?


I might be wrong, but I believe a value of 31 also causes a compiler
warning.
Since the compiler evaluates macro-defined values it default casts to
'int',
which is too small for to hold 1 << 31 (overflow, becomes negative).
I think it should be added a cast to unsigned int (cyg_uint32 or
whatever), or?
I guess one has to try to compile with the limit values to know for
sure...
/Fredrik

Andrew Lunn wrote:

> On Tue, Jan 28, 2003 at 04:22:10AM +0000, Jonathan Larmour wrote:
> > Andrew Lunn wrote:
> > >It seems to me the cdl legal_value is wrong.
> > >
> > >There is a bitmap kept for which kernel thread data entries are in
> > >use. So for example, if thread entry 10 is in use, bit 10 of
> > >thread_data_map will be reset. Now thread_data_map is of type
> > >cyg_count32. ie its 32 bits. So the upper legal value should be 31,
> > >not 65535. 32 may work, but that depends on what value 1<<32 gives.
> >
> > One too big for a 32-bit word certainly! I've corrected this in CVS.
>
> Thats what im relying on. 1<<32 should be 0 on most processors. If so,
> it all works out correct. But its not something i would trust unless
> it was written down in some standard and gcc actually implements that
> standard.
>
>    Andrew
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]