From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Veer To: joerg.rapka@duagon.com Cc: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] cyg_semaphore_post Date: Wed, 13 Jun 2001 08:27:00 -0000 Message-id: <200106131527.f5DFRYB23389@sheesh.cambridge.redhat.com> References: X-SW-Source: 2001-06/msg00448.html >>>>> "Joerg" == Joerg Rapka 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