This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Question CYGNUM_KERNEL_THREADS_DATA_MAX?
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.
Andrew
On Mon, Jan 27, 2003 at 06:41:56PM +0100, Fredrik Hederstierna wrote:
> I tried to change the cdl_option below and got a warning
>
> cdl_option CYGNUM_KERNEL_THREADS_DATA_MAX {
> display "Number of words of per-thread data"
> flavor data
> legal_values 4 to 65535
> default_value 65535
> description "..."
> }
>
> In the code its used like this
>
> // Set the data map bits for each free slot in the data array.
> cyg_ucount32 Cyg_Thread::thread_data_map =
> (~CYGNUM_KERNEL_THREADS_DATA_ALL) &
>
> ((1<<CYGNUM_KERNEL_THREADS_DATA_MAX)-1);
>
>
> This shifts 1 << 65535, which looks strange to me... and GCC gives me a
> warning.
> Is this code correct?
>
> /Fredrik Hederstierna
>
>
>
> --
> 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