public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Re: why is it wrong to call cyg_semaphore_post() in ISR???
Date: Tue, 20 Jun 2006 15:47:00 -0000	[thread overview]
Message-ID: <20060620154722.63108545CB@rivatek.dnsalias.net> (raw)
In-Reply-To: <20060620131247.GJ21228@lunn.ch>

In gmane.os.ecos.general, you wrote:

> Also, you would expect 99% of your DSR's to run straight after the ISR
> in the ISR context. So normally a DSR does not cause an additional
> context switch, it is just piggybacked onto the ISR context switch.

Another way to visualize it is to think about ISRs that are
split into two parts.  The first part runs with interrupts
disabled, then interrupts are enabled and the second part runs.
Linux device driver interrupts used to be done that way: there
was a "top half" and a "bottom half".  The top half (which one
always tried to keep much smaller than the bottom half) was
entered with interrupts disabled.  At some point in the code,
you enabled interrupts and continued on with interrupts
enabled.

This isn't 100% accurate, since 

 1) there are times when DSRs are "locked out" so that some
    normal task code runs between what would have been the "top
    half" and the "bottom half"

 2) the order of execution of multiple pending DSRs is
    undefined.  [even though we all know what it is. ;) ]

-- 
Grant Edwards                   grante             Yow!  There's a lot of BIG
                                  at               MONEY in MISERY if you have
                               visi.com            an AGENT!!

-- 
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:[~2006-06-20 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 12:52 [ECOS] " Goldschmidt Simon
2006-06-20 13:12 ` Andrew Lunn
2006-06-20 15:47   ` Grant Edwards [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=20060620154722.63108545CB@rivatek.dnsalias.net \
    --to=grante@visi.com \
    --cc=ecos-discuss@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).