From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12594 invoked by alias); 8 Jun 2006 17:39:24 -0000 Received: (qmail 12585 invoked by uid 22791); 8 Jun 2006 17:39:23 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0102.google.com (HELO nz-out-0102.google.com) (64.233.162.202) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 Jun 2006 17:39:21 +0000 Received: by nz-out-0102.google.com with SMTP id i1so444427nzh for ; Thu, 08 Jun 2006 10:37:36 -0700 (PDT) Received: by 10.36.121.19 with SMTP id t19mr2653137nzc; Thu, 08 Jun 2006 09:42:57 -0700 (PDT) Received: from taurus ( [82.100.245.2]) by mx.gmail.com with ESMTP id 18sm2813266nzo.2006.06.08.09.42.56; Thu, 08 Jun 2006 09:42:57 -0700 (PDT) Message-ID: <000501c68b1a$68b523b0$ea14a8c0@taurus> From: "Monica Dsz" To: "ecos discuss" Date: Thu, 08 Jun 2006 17:39:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.2869 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] why is it wrong to call cyg_semaphore_post() in ISR??? X-SW-Source: 2006-06/txt/msg00089.txt.bz2 Hallo all, I am new to eCos(and also to embedded). The eCos documentation says that ISR should not involve any kernel calls.But I want to know why cyg_semaphore_post() is not allowed in ISR(Interrupt service routine). It doesnt block. and i tried to use it though documentation says we shouldnt. It worked for me with the following code. cyg_uint32 timer_isr(cyg_vector_t vector,cyg_addrword_t data) { led_toggle(); //Toggle the LED isr_counter++; //32 bit ISR counter cyg_interrupt_acknowledge( vector ); //acknowledge the Interrupt to the processor cyg_semaphore_post( &intr_occured ); //give the semaphore,so that task waiting for it wakes up return( CYG_ISR_HANDLED ); // Inform the kernel that ISR is handled } I wonder why in eCos,a semaphore cannot be posted in ISR. In VxWorks we can give a semaphore in ISR. Can anybody give me a pointer to documentation or an explanation for this. Thank you in advance monica -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss