* [ECOS] dsr_list not initialized as NULL
@ 2008-01-08 11:30 Yi Tang
2008-01-08 11:44 ` Gary Thomas
0 siblings, 1 reply; 5+ messages in thread
From: Yi Tang @ 2008-01-08 11:30 UTC (permalink / raw)
To: eCos-discuss
Hi All,
I'm working with ecos on an soft-core processor on Xilinx FPGA ml401 board.
And I found that the Cyg_Interrupt::dsr_list[CYGNUM_KERNEL_CPU_MAX] (it is
an single processor system) in my system is not initialized as NULL. Thus it
cause the dsr_pending() check to always be true and also cause the system
point to invalid pointer.
Since the dsr_list is defined as volatile, just wondering if the HAL level
has some funtion to alter it and cause the trouble? Or it is simply the
memory on FPGA not initialized with all zero?
I found the same .exe file works fine on the simulation processor on my host
computer.
inline cyg_bool Cyg_Interrupt::DSRs_pending()
{
HAL_SMP_CPU_TYPE cpu = CYG_KERNEL_CPU_THIS();
#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE
return dsr_table_head[cpu] != dsr_table_tail[cpu];
#endif
#ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST
return dsr_list[cpu] != NULL;
#endif
};
Thanks and regards,
Yi Tang
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] dsr_list not initialized as NULL
2008-01-08 11:30 [ECOS] dsr_list not initialized as NULL Yi Tang
@ 2008-01-08 11:44 ` Gary Thomas
2008-01-08 12:05 ` Yi Tang
0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2008-01-08 11:44 UTC (permalink / raw)
To: Yi Tang; +Cc: eCos-discuss
Yi Tang wrote:
> Hi All,
>
> I'm working with ecos on an soft-core processor on Xilinx FPGA ml401
> board. And I found that the
> Cyg_Interrupt::dsr_list[CYGNUM_KERNEL_CPU_MAX] (it is an single
> processor system) in my system is not initialized as NULL. Thus it cause
> the dsr_pending() check to always be true and also cause the system
> point to invalid pointer.
>
> Since the dsr_list is defined as volatile, just wondering if the HAL
> level has some funtion to alter it and cause the trouble? Or it is
> simply the memory on FPGA not initialized with all zero?
>
> I found the same .exe file works fine on the simulation processor on my
> host computer.
>
> inline cyg_bool Cyg_Interrupt::DSRs_pending()
> {
> HAL_SMP_CPU_TYPE cpu = CYG_KERNEL_CPU_THIS();
> #ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_TABLE
>
> return dsr_table_head[cpu] != dsr_table_tail[cpu];
>
> #endif
> #ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST
>
> return dsr_list[cpu] != NULL;
>
> #endif
> };
>
Everything which ends up in 'bss' (such as unitialized
arrays) should be zeroed when eCos starts up.
What architecture (CPU core) is in your FPGA? The code
that does this is in the eCos startup code, typically:
hal/<arch>/arch/current/src/vectors.S
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] dsr_list not initialized as NULL
2008-01-08 11:44 ` Gary Thomas
@ 2008-01-08 12:05 ` Yi Tang
2008-01-08 12:35 ` Andrew Lunn
0 siblings, 1 reply; 5+ messages in thread
From: Yi Tang @ 2008-01-08 12:05 UTC (permalink / raw)
To: Gary Thomas; +Cc: eCos-discuss
Hi Gary,
Thanks for your reply. So you mean the dsr_list should be zeroed when
bootup.
static Cyg_Interrupt* volatile dsr_list[CYGNUM_KERNEL_CPU_MAX]
I'm working on the leon3 soft core (sparc arch). The strange thing is that I
run the same executable file on the leon3 simulation processor and dsr_list
is zeroed ok at startup.
Also I wonder whether that would cause some trouble if I modify the kernel
file and initialize the dsr_list to NULL manually?
Regards,
Yi
----- Original Message -----
> Everything which ends up in 'bss' (such as unitialized
> arrays) should be zeroed when eCos starts up.
>
> What architecture (CPU core) is in your FPGA? The code
> that does this is in the eCos startup code, typically:
> hal/<arch>/arch/current/src/vectors.S
>
> --
> ------------------------------------------------------------
> Gary Thomas | Consulting for the
> MLB Associates | Embedded world
> ------------------------------------------------------------
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] dsr_list not initialized as NULL
2008-01-08 12:05 ` Yi Tang
@ 2008-01-08 12:35 ` Andrew Lunn
2008-01-12 8:19 ` Yi Tang
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2008-01-08 12:35 UTC (permalink / raw)
To: Yi Tang; +Cc: eCos-discuss
> Also I wonder whether that would cause some trouble if I modify the kernel
> file and initialize the dsr_list to NULL manually?
You will run into other problems. A lot of code assumes the bss is
zero'd. You need to find and fix this problem.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] dsr_list not initialized as NULL
2008-01-08 12:35 ` Andrew Lunn
@ 2008-01-12 8:19 ` Yi Tang
0 siblings, 0 replies; 5+ messages in thread
From: Yi Tang @ 2008-01-12 8:19 UTC (permalink / raw)
To: eCos-discuss
Hi Andrew and Gary
Thanks for you guys' reply.
I have found the problem, I forgot to add the processor option -msoft-float
in the link process (in my makefile the link process and the compile are
separate). A tiny omission can cause so much trouble.
Regards,
Yi
----- Original Message -----
From: "Andrew Lunn" <andrew@lunn.ch>
To: "Yi Tang" <yitang@itee.uq.edu.au>
Cc: "eCos-discuss" <ecos-discuss@ecos.sourceware.org>
Sent: Tuesday, January 08, 2008 10:32 PM
Subject: Re: [ECOS] dsr_list not initialized as NULL
>> Also I wonder whether that would cause some trouble if I modify the
>> kernel
>> file and initialize the dsr_list to NULL manually?
>
> You will run into other problems. A lot of code assumes the bss is
> zero'd. You need to find and fix this problem.
>
> Andrew
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-12 8:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-08 11:30 [ECOS] dsr_list not initialized as NULL Yi Tang
2008-01-08 11:44 ` Gary Thomas
2008-01-08 12:05 ` Yi Tang
2008-01-08 12:35 ` Andrew Lunn
2008-01-12 8:19 ` Yi Tang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).