This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Disabling interrupts when locking the scheduler
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Erik Christiansen <erik at dd dot nec dot com dot au>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: 03 Jun 2005 10:37:35 +0100
- Subject: Re: [ECOS] Disabling interrupts when locking the scheduler
- References: <20050603084643.GC716@dd.nec.com.au>
Erik Christiansen <erik@dd.nec.com.au> writes:
> The possibility of disabling interrupts when locking the scheduler seems
> built into the calling sequence:
>
> Cyg_Scheduler::lock() <-- Generates no code, anywhere. *1
> inc_sched_lock()
> HAL_SMP_SCHEDLOCK_INC
> HAL_DISABLE_INTERRUPTS <-- Disables interrupts, if invoked.
>
> While ref/kernel-interrupts.html confirms that interrupts are normally not
> disabled, for improved interrupt latency, the code is there, if I can just
> figure out how to turn it on. It's not conditionals, but seems to be
> inheritance which causes Cyg_Scheduler::lock() to be excluded.
>
> Has anyone tried this before?
>
> (I'd prefer to enable the latent code, rather than just poke a
> HAL_DISABLE_INTERRUPTS in front of Cyg_Scheduler::lock() in 66
> places, and repeat for enabling.)
>
> *1) No timeslicing, CYGSEM_HAL_USE_ROM_MONITOR == 1.
Why do you want to do this?
eCos is carefully designed not to disable interrupts unnecessarily. It
will probably fail catastrophically if interrupts are disabled during
the scheduler lock periods.
The interrupt disable you have found is only part of the SMP code, and
is matched by a HAL_RESTORE_INTERRUPTS() at the end of the
HAL_SMP_SCHEDLOCK_INC() macro. So interrupts are disabled for a very
short period, inside that macro.
--
Nick Garnett eCos Kernel 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