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: What is RedBoot_INIT_TAB,



On 31-May-2001 Narayana, Venkat A. wrote:
> Hi,
> I am trying to make a ROM startup for my XScale based board
> and i am getting an error, while single-stepping this code, which is in
> main.c/cyg_start fucn:
> 
> for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> &__RedBoot_INIT_TAB_END__;  init_entry++) {
>         (*init_entry->fun)();
>     }
> 
> I found that RedBoot_INIT_TAB is defined, in CYG_HAL_TABLE_BEGIN macro,
> but by the time i reach the above point, i.e cyg_start function, i haven't
> seen anything
> which is poulating this Table. So the question is, if no one is putting some
> data(actual a 
> function pointer), the why is it that we are calling init_entry->fun,
> function?

This table is filled in using the RedBoot_init() macro.  E.g. this is used
by the network initialization code in the file "redboot/current/src/net/net_io.c"

Depending on your configuration, you may or not have any entries in the table.

I'd suggest that you put some prints around the call and see what it's calling
and whether or not it gets back.  For example:

        printf("Calling %p/%p\n", init_entry, init_entry->fun);
        (*init_entry->fun)();
        printf("Back\n");

The extra value printed (init_entry) is to see whether or not things are properly
aligned.  This particular table has only 4 byte entries, but I've seen the compiler
do funny things like try and align table elements on 16 byte boundaries, etc.

> Is there something i didn't understood or missed?
> Could i choose to call this guy, only when the board is ' warm_reset'?

No, it needs to be there always.

Please run the test I've outlined. Let us know what happens.


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