public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Davy Wouters <davy.wouters.atos@gmail.com>
Cc: ecos-devel@ecos.sourceware.org
Subject: Re: New hal port + interrupts + rescheduling + call_pending_dsrs 	problem
Date: Mon, 30 Jun 2008 08:48:00 -0000	[thread overview]
Message-ID: <20080630084830.GB21756@lunn.ch> (raw)
In-Reply-To: <111ced750806300126v5ccc8120rcfa3cb106e891920@mail.gmail.com>

> The DSR mechanism has nothing to do with processor specific interrupt
> handling but more with the eCos kernel internal stuff, correct?
> In that case what is the exact role of the DSR in eCos? When to
> implement one or not in a device driver?

ISR can run any time interrupts are enabled. There is very little you
can actually do in ISR context, just read/write bits in the hardware,
generally you just disable the interrupt source. The ISR handler
cannot do anything with the eCos scheduler.

DSR will only run when the eCos scheduler is in a consistent state,
i.e.  the scheduler is not locked. DSR are allowed to do none blocking
calls, eg signal a semaphore to wake up a thread etc.

> I'm asking this because I thought that the DSR needed to be executed
> after returning from the interrupt (reti or what ever), which is not
> the case, in order to allow other interrupts
> at this point. I thought that when combining ISR and DSR in one
> interrupt handling of the processor, this would take too long and
> deteriorate real-time behaviour?

Your ISR and DSR handlers should not do any activities which take a
long time, since while ISR & DSR are running, threads are not
running. If you do need to do a lot of work it is much better to have
a thread doing it, so the scheduler can pre-empty it for a higher
priority thread. The TCP/IP stack follows this model. The Ethernet
device drivers have a thread doing the actual copy of the packet from
the hardware to the stack and the stack is run in a thread.

    Andrew

      reply	other threads:[~2008-06-30  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 14:41 Davy Wouters
2008-06-27 18:25 ` Andrew Lunn
2008-06-30  8:27   ` Davy Wouters
2008-06-30  8:48     ` Andrew Lunn [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=20080630084830.GB21756@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davy.wouters.atos@gmail.com \
    --cc=ecos-devel@ecos.sourceware.org \
    /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).