From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8443 invoked by alias); 21 Nov 2003 18:28:36 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 8428 invoked from network); 21 Nov 2003 18:28:35 -0000 Received: from unknown (HELO mail.dynazign.com) (66.0.244.3) by sources.redhat.com with SMTP; 21 Nov 2003 18:28:35 -0000 Received: from aaronc [66.0.244.2] by mail.dynazign.com with ESMTP (SMTPD32-7.07) id A6BC430001C; Fri, 21 Nov 2003 13:17:32 -0500 From: "Aaron Case" To: "Gary Thomas" Cc: "Ecos-Discuss" Date: Fri, 21 Nov 2003 18:28:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal In-Reply-To: <1069435708.1961.726.camel@hermes> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: RE: [ECOS] context for creating interrupts on edb7312 X-SW-Source: 2003-11/txt/msg00305.txt.bz2 Aaron Case Firmware Engineer Dynazign, Inc. Charlotte, USA > -----Original Message----- > From: Gary Thomas [mailto:gary@mlbassoc.com] > Sent: Friday, November 21, 2003 12:28 PM > To: Aaron Case > Cc: Ecos-Discuss > Subject: RE: [ECOS] context for creating interrupts on edb7312 > > > On Fri, 2003-11-21 at 10:22, Gary Thomas wrote: > > On Fri, 2003-11-21 at 09:32, Aaron Case wrote: > > > > > > > > > > Im looking for something along the lines of #define > > > > hal_interrupts_enable > > > > > cyg_interrupt_enable(). > > > > > > > > Actually, there is no explicit call like this (anymore). Interrupts > > > > will get enabled when the scheduler "starts" the first > thread (minimally > > > > the 'idle' thread). Thread contexts are initialized with interrupts > > > > enabled and this just sort of falls out with the washing :-) > > > > > > > > -- > > > > Gary Thomas > > > > MLB Associates > > > > > > > > > > > > > > Gary, > > > > > > Thanks for the prompt answer. I was speaking more in the > context of linking > > > and compiling the image. > > > > > > I see that a call to enable interrupts is not necessary when > threads are > > > initialized. > > > > > > I also see the cyg_interrupt_enable in the map file, which > jumps to the > > > hal_interrupts_enable( from vector.S but not in the map file) > code in the > > > application. > > > > I'm not sure I understand what you mean by this (in the map file?), but > > if a function isn't used (cyg_interrupt_enable() is not used by the > > kernel except for a single test), then even if that function is defined > > it doesn't end up in the resulting application. > > > > IMO there is absolutely no need to ever call cyg_interrupt_enable(), > > except for the kernel test which tests it. > > > > If you need to manipulate the interrupt state (and there are very few > > cases even for this), this is a better approach: > > > > cyg_uint32 state; > > HAL_DISABLE_INTERRUPTS(state); // Disables interrupts > > ... > > HAL_RESTORE_INTERRUPTS(state); // Restore interrupts > > Or, even better when writing device drivers: > > cyg_drv_isr_lock(); > ... > cyg_drv_isr_unlock(); > > -- > Gary Thomas > MLB Associates > > Ok, Ive got it worked out now. Thanks, Aaron Case -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss