This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
[ECOS/STUB] Bug in CtrlC handling when sharing Ethernet btw Redboot/eCos
- From: achataignier at neotion dot com
- To: ecos-discuss at sources dot redhat dot com
- Cc: achataignier at neotion dot com
- Date: Sat, 30 Oct 2004 11:57:42 +0200
- Subject: [ECOS] [ECOS/STUB] Bug in CtrlC handling when sharing Ethernet btw Redboot/eCos
I found a bug in the CtrlC handling when sharing the Ethernet connection
between eCos application and Redboot/stubs.
What happens is that HAL_CTRLC_CHECK is called from the function
eth_drv_run_deliveries() in io/eth/current/src/net/eth_drv.c. This function is
in a thread context, which is not compatible with the way hal_ctrlc_check
calls internally cyg_hal_user_break(), since it assumes it is being called
from an ISR.
The result is CtrlC not working sometimes, particularly when some time happens
between the Ethernet ISR, and the moment cyg_hal_user_break() is called, since
the stack area pointed to by hal_saved_interrupt_state may have been rewritten
in between. This is the case for instance if the host sends an ARP request to
Redboot before sending the Ctrlc.
I see a ugly solution by adding a global variable, set by
eth_drv_run_deliveries() and checked by cyg_hal_user_break(), but this is not
as clean as I would want it to be.
Any suggestion for a clean fix ?
Regards,
Arnaud Chataignier.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss