public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: Warren Jasper <wjasper@tx.ncsu.edu>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] semaphore bug??
Date: Tue, 14 Aug 2001 13:09:00 -0000	[thread overview]
Message-ID: <20010814151106.A13809@visi.com> (raw)
In-Reply-To: <200108141921.PAA09282@lx10.tx.ncsu.edu>

On Tue, Aug 14, 2001 at 03:21:05PM -0400, Warren Jasper wrote:
> 
> I have written an application that blocks on a semaphore.  When
> an interrupt is generated, the semaphore is released, and the
> program **should** continue.  Here is a snippit:
> 
> /* synchronization semaphore */
> static  cyg_sem_t dma_store_done_sem;
> 
> // I then initialize the semaphore to 0 and register the isr ...
> 
> static cyg_uint32 dma_store_done_isr(cyg_vector_t vector, cyg_addrword_t data, cyg_addrword_t *regs)
> {
>   CYG_WORD32 dspctl;
> 
>   //diag_printf("Entered dma_store_done_isr.  vector = %d Releasing semaphore.\n", vector);
>   cyg_interrupt_acknowledge(vector);
>   /* put the DMA into reset  */
>   HAL_READ_UINT32_MCB(DSPCTL, dspctl);
>   dspctl |= ResetDMA;
>   HAL_WRITE_UINT32_MCB(DSPCTL, dspctl);
>   cyg_semaphore_post(&dma_store_done_sem);

I don't think you can post to a semaphore from an ISR.  You'll
have to run a DSR and do it there.  There's a table in the eCos
Reference Manual (Device Driver Interface to the Kernel) that
shows what functions may be called from an ISR.  About the only
thing you can do is ack/mask/unmask interrupts and run a DSR.

-- 
Grant Edwards
grante@visi.com

  reply	other threads:[~2001-08-14 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-14 12:21 Warren Jasper
2001-08-14 13:09 ` Grant Edwards [this message]
2001-08-14 18:55 Geoff Patch
2001-08-15  0:15 ` Andrew Lunn
2001-08-15  0:24   ` Jonathan Larmour

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=20010814151106.A13809@visi.com \
    --to=grante@visi.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=wjasper@tx.ncsu.edu \
    /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).