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]

Re: CYGIMP_KERNEL_INTERRUPTS_CHAIN


Rafael Rodríguez Velilla wrote:
> 
>   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?

Yes. Or at least it should be.

>   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?

Assuming this is ARM (since you were asking about FIQ), if you look in
hal/arm/arch/VERSION/src/arm.ld you should see:

#define SECTION_bss(_region_,  _vma_, _lma_) \
    .bss _vma_ : _lma_ \
    { __bss_start = ABSOLUTE (.); \
    *(.scommon) *(.dynbss) *(.bss*) *(COMMON) \
    __bss_end = ABSOLUTE (.); } \
    > _region_

So COMMON should be placed between __bss_start and __bss_end which should
mean it gets zero initialized. If you don't think this is happening
generate a linker map file (put -Wl,-Map,foo on your link line).

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


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