This is the mail archive of the ecos-discuss@sources.redhat.com 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_interrupt_disable/enable question



One followup question:

Does cyg_disable_interrupt also mask the scheduler interrupt (ie, disables the
scheduler)?
Thanks.





Gary Thomas <gthomas@ecoscentric.com> on 09/21/2002 12:52:09 PM


To:   Andy Tenka/DELCO@DELCO
cc:   eCos Discussion <ecos-discuss@sources.redhat.com>

Subject:  Re: [ECOS] cyg_interrupt_disable/enable question



On Sat, 2002-09-21 at 10:46, andy.tenka@delphiauto.com wrote:
>
>
> Do cyg_interrupt_enable and cyg_interrupt_disable always have to have a 1-1
> correspondence?
>
> In other words, if we call cyg_interrupt_disable twice, and call
> cyg_interrupt_enable once, will the
> interrupts be enabled?  (I realize that this is not a clean thing to do, this
is
> just an academic question).

These functions are not "tied" in any way.
  HAL_ENABLE_INTERRUPTS() - enables the interrupts, no matter what
  HAL_DISABLE_INTERRUPTS() - disables them, no matter what

If you want to disable interrupts and then restore the previous
interrupt state, use this sequence:
  cyg_uint32 old;
  HAL_DISABLE_INTERRUPTS(old);
    ...
  HAL_RESTORE_INTERRUPTS(old);


Note: this is often not necessary - simply disabling scheduling is
often a better choice:
  cyg_scheduler_lock();
    ...
  cyg_scheduler_unlock();

--
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------





Received: from ahmlir3.mail.eds.com ([205.191.24.43]) by ustryg98.delphiauto.net
(Lotus SMTP MTA v4.6.7  (934.1 12-30-1999)) with SMTP id 05256C3B.0062BA8B; Sat,
21 Sep 2002 12:58:22 -0500
Received: from ahmler4.mail.eds.com (ahmler4.mail.eds.com [192.85.154.77])
     by ahmlir3.mail.eds.com (8.11.6/8.11.6) with ESMTP id g8LI16O16883
     for <andy.tenka@delphiauto.com>; Sat, 21 Sep 2002 14:01:06 -0400 (EDT)
Received: from ahmler4.mail.eds.com (localhost [127.0.0.1])
     by ahmler4.mail.eds.com (8.11.6/8.11.6) with ESMTP id g8LHqBe09641
     for <andy.tenka@delphiauto.com>; Sat, 21 Sep 2002 13:52:11 -0400
Received: from hermes.chez-thomas.org (hermes.chez-thomas.org [63.225.98.241])
     by ahmler4.mail.eds.com (8.11.6/8.11.6) with ESMTP id g8LHqBn09635
     for <andy.tenka@delphiauto.com>; Sat, 21 Sep 2002 13:52:11 -0400
Received: from localhost.localdomain (localhost [127.0.0.1])
     by hermes.chez-thomas.org (Postfix) with ESMTP
     id CBC5D235AE; Sat, 21 Sep 2002 11:52:09 -0600 (MDT)
Subject: Re: [ECOS] cyg_interrupt_disable/enable question
From: Gary Thomas <gthomas@ecoscentric.com>
To: andy.tenka@delphiauto.com
Cc: eCos Discussion <ecos-discuss@sources.redhat.com>
In-Reply-To: <05256C3B.005C7509.00@notes.delphiauto.com>
References: <05256C3B.005C7509.00@notes.delphiauto.com>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
X-Mailer: Ximian Evolution 1.0.3 (1.0.3-4)
Date: 21 Sep 2002 11:52:09 -0600
Message-Id: <1032630729.17416.193.camel@hermes.chez-thomas.org>
Mime-Version: 1.0


|--------------------------------------->
|USTRYG98/us/delphiauto                 |
|USTRYH99/us/delphiauto                 |
|USKOKH99/us/delphiauto                 |
|USKOKHM1/DELCO                         |
|USKOKM04/DELCO                         |
|--------------------------------------->
  >---------------------------------------|
  |09/21/2002 12:58:29 PM - 09/21/2002    |
  |12:58:30 PM                            |
  |09/21/2002 12:58:33 PM - 09/21/2002    |
  |12:58:34 PM                            |
  |09/21/2002 12:58:34 PM - 09/21/2002    |
  |12:58:35 PM                            |
  |09/21/2002 12:58:32 PM - 09/21/2002    |
  |12:58:33 PM                            |
  |09/21/2002 12:58:29 PM - 09/21/2002    |
  |12:58:30 PM                            |
  >---------------------------------------|






regards,

Andy Tenka
Delphi Automotive Systems
(765)451-8777
Andy.Tenka@delphiauto.com



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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