[ECOS] cyg_semaphore_post

Bart Veer bartv@redhat.com
Wed Jun 13 08:27:00 GMT 2001


>>>>> "Joerg" == Joerg Rapka <joerg.rapka@duagon.com> writes:

    Joerg> Is it allowed to call cyg_semaphore_post from within an
    Joerg> ISR?

No. In general it is not possible to call any kernel function from
inside an ISR because kernel operations like manipulating a semaphore
only lock the scheduler, they do not disable interrupts. This helps to
keep down the interrupt latency. Instead the ISR should indicate that
its corresponding DSR should be run, using its return value. The DSR
will be run when it is safe to do so. Usually this will be
immediately, but if the interrupted code was in a critical section and
had locked the scheduler then the DSR will be run a little bit later
when the critical section has been exited. The DSR can make
non-blocking calls such as cyg_semaphore_post()

For more information, see e.g. the section "eCos Interrupt Model" in
the Reference Guide.

Bart



More information about the Ecos-discuss mailing list