This is the mail archive of the ecos-patches@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] |
Other format: | [Raw text] |
Dear Bart, I applied your suggestion with success. This solution is much more elegant than the one I proposed. CtrlC is now working correctly in all cases on my target. Here is attached the corresponding patch for the two files implied. This cancels and replaces the previous patch. Caution to users of this new version : different files are implied compared to my first emails. Do NOT apply the patches contained in my previous emails if you apply this one. To Gary : I think this new patch can be included in the CVS tree, don't you think ? Regards, Arnaud. -----Message d'origine----- De : Bart Veer [mailto:bartv@ecoscentric.com] Envoyé : mardi 2 novembre 2004 23:03 À : achataignier@neotion.com Cc : ecos-discuss@sources.redhat.com Objet : Re: [ECOS] RE : Bug in CtrlC handling when sharing Ethernet btw Redboot/eCos >>>>> "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
Attachment:
intr.patch
Description: Binary data
Attachment:
drv_api.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |