This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RE : Bug in CtrlC handling when sharing Ethernet btw Redboot/eCos
- From: Bart Veer <bartv at ecoscentric dot com>
- To: achataignier at neotion dot com
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Tue, 2 Nov 2004 22:02:44 +0000 (GMT)
- Subject: Re: [ECOS] RE : Bug in CtrlC handling when sharing Ethernet btw Redboot/eCos
- References: <05d201c4c0b8$b5cf6580$0100a8c0@ArnaudC>
>>>>> "Arnaud" == Arnaud Chataignier <achataignier@neotion.com> writes:
Arnaud> Dear Bart,
Arnaud> Thank you for your answer on this topic. I agree with your
Arnaud> conclusions.
<snip>
Arnaud> 2 - as you say, we can also clear
Arnaud> hal_saved_interrupt_state before in
Arnaud> eth_drv_run_deliveries() before calling HAL_CTRLC_CHECK.
Arnaud> This will lead to always break execution in
Arnaud> eth_drv_run_deliveries(), but the user can still see the
Arnaud> state of other threads by using the 'thread awareness'
Arnaud> functionnality of GDB/stubs. Note that just clearing the
Arnaud> variable hal_saved_interrupt_state in
Arnaud> eth_drv_run_deliveries() is not enough, since a new
Arnaud> interrupt (timer for instance) can occur between the
Arnaud> variable clearance, and the call to
Arnaud> cyg_hal_user_break()(). But I know how to overcome this
Arnaud> problem by using a global variable (the ugly solution I
Arnaud> described below).
That is not exactly what I suggested. Instead a better place to clear
hal_saved_interrupt_state would be in the kernel's interrupt_end()
routine, which gets invoked at the end of a interrupt processing.
Probably just before the Cyg_Scheduler::unlock() call.
When debugging over serial there should be no difference in behaviour,
the ctrl-C detection happens in the ISR so hal_saved_interrupt_state
will be defined.
When debugging over ethernet, inside eth_drv_run_deliveries(),
hal_saved_interrupt_state will be clear. There is no need to worry
about other interrupts, these may briefly cause
hal_saved_interrupt_state to become set but the variable will be
cleared again before the thread resumes.
This should eliminate the need for an extra global, or an extra
argument to HAL_CTRLC_CHECK(), or anything similar.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss