This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: cyg_flag_setbits() question
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Stefan Sommerfeld <sommerfeld at mikrom dot de>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 8 Aug 2005 23:43:59 +0200
- Subject: Re: [ECOS] cyg_flag_setbits() question
- References: <006701c599e0$b6187f70$152ca8c0@nullnullsix>
On Fri, Aug 05, 2005 at 07:11:25PM +0200, Stefan Sommerfeld wrote:
> Hi,
>
> I've two quick questions:
>
> Is it save to call cyg_flag_setbits() from an IRQ or should i better use a
> DSR?
http://ecos.sourceware.org/docs-latest/ref/kernel-interrupts.html
Which says:
An ISR is allowed to make very few kernel calls. It can manipulate the
interrupt mask, and on SMP systems it can use spinlocks. However an
ISR must not make higher-level kernel calls such as posting to a
semaphore, instead any such calls must be made from the DSR. This
avoids having to disable interrupts throughout the kernel and thus
improves interrupt latency.
So use a DSR.
> Is there a save way to transmit information from IRQ to DSR? As far as i
> know the DSR's are queue's, so i need to transmit maybe which was the IRQ
> cause of the IRQ to the DSR's.
Later in the same page it says:
void
dsr_function(cyg_vector_t vector,
cyg_ucount32 count,
cyg_addrword_t data)
{
}
vector is the source of the interrupts which caused the DSR to
trigger.
You can also use data as a pointer to an information block if you
want.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss