This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cyg_flag_setbits() question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]