public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Erik Christiansen <erik@dd.nec.com.au>
To: Nick Garnett <nickg@ecoscentric.com>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Disabling interrupts when locking the scheduler
Date: Mon, 06 Jun 2005 08:50:00 -0000	[thread overview]
Message-ID: <20050606084905.GA708@dd.nec.com.au> (raw)
In-Reply-To: <m3d5r37pcw.fsf@xl5.calivar.com>

On Fri, Jun 03, 2005 at 10:37:35AM +0100, Nick Garnett wrote:
> Erik Christiansen <erik@dd.nec.com.au> writes:
> > 
> > *1) No timeslicing, CYGSEM_HAL_USE_ROM_MONITOR == 1.
> 
> Why do you want to do this?

The reason is that we have configured eCos to leave interrupt handling
to our pre-existing application, and initialised the interrupt vectors
from our pre-existing BSP. There are then no DSRs.

If interrupts are disabled while in the kernel, then it seems "in
principle" safe for ISRs to directly employ the kernel API, and the lack
of DSRs is no longer a problem. (Please accept my apologies for
attempting such acts with eCos.)

> eCos is carefully designed not to disable interrupts unnecessarily.

Understood from the documentation. (And I'd like to have the time to go
with that, but when porting an existing application, there can sometimes
be strong imperatives to avoid a major rebuild.) We can tolerate a
little interrupt latency.

> 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.

Oh Oh! Yes, only disabling interrupts for the whole kapi function, not
just during locking/unlocking, would give their use in an ISR any chance
of success. (But I don't yet understand why the longer disable period is
such a big risk.)

Thank you for your analysis & warnings. We'll give it a shot, and see
what happens. It's bound to teach me something. :-)

Erik

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2005-06-06  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03  8:48 Erik Christiansen
2005-06-03  9:37 ` Nick Garnett
2005-06-06  8:50   ` Erik Christiansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050606084905.GA708@dd.nec.com.au \
    --to=erik@dd.nec.com.au \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=nickg@ecoscentric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).