[ECOS] CYGIMP_KERNEL_INTERRUPTS_CHAIN

Rafael Rodríguez Velilla rrv@tid.es
Mon May 14 12:46:00 GMT 2001


  This only makes an static memory allocation. It would be initialized if it is allocated at the bss section, isn't it?
  In eCos I have seen some other static members declared and initilized in the same line, for example, in the same source
kernel/VERSION/src/intr/intr.cxx:

Cyg_Interrupt *Cyg_Interrupt::dsr_list=NULL;

  Is this redundant? Does this declaration affect the section in wich it is going to fall into?
  If this initialization is made at compile-time, then it makes the system take a little more to download to the target, if
it is zeroed  at run-time then it will take a little more at run-time (but surely less time than while downloading).

  I have just tried to compile eCos with CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE enabled (it has both initialized static members
and unitilized), it contains the following code:
Cyg_Interrupt *Cyg_Interrupt::dsr_table[CYGNUM_KERNEL_INTERRUPTS_DSRS_TABLE_SIZE]
cyg_ucount32 Cyg_Interrupt::dsr_table_head = 0;
cyg_ucount32 Cyg_Interrupt::dsr_table_tail = 0;

and when I examine the object generated with
arm-elf-nm -C kernel_intr.o |grep dsr_table
it generates the following output:
00000080 C Cyg_Interrupt::dsr_table
00000004 D Cyg_Interrupt::dsr_table_head
00000004 D Cyg_INterrupt::dsr_table_tail

The D implies that the symbol is in the initialized data section, while the C implies that the symbol is "common", and
unitialized. I see in the documentation that the symbols in BSS have a B, so dsr_table is not initialized while zeroing the
BSS section. Where is it initialized then?



> Rafael Rodríguez Velilla wrote:
> >
> >   Where is Cyg_Interrupt::chain_list initialized?
> >
> >   It is necessary for its correct behaviour to initialize all the array to NULL but I don't see where does this happens.
>
> kernel/VERSION/src/intr/intr.cxx:
>
> //
> -------------------------------------------------------------------------
> // Interrupt chaining statics.
>
> #ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN
>
> Cyg_Interrupt *Cyg_Interrupt::chain_list[CYGNUM_HAL_ISR_COUNT];
>
> #endif
>
> so it should be initialied to null throught the array.
>
> Jifl
> --
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
> Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

--
Rafael Rodríguez Velilla        rrv@tid.es
Telefónica I+D          http://www.tid.es
Telf: +34 - 91 337 4270





More information about the Ecos-discuss mailing list