This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Atomic operations
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] Atomic operations
- From: Nick Garnett <nickg at cygnus dot co dot uk>
- Date: 08 Aug 2000 18:20:14 +0100
- Newsgroups: cygnus.sourceware.ecos.d
- Organization: Cygnus Solutions, a Red Hat company (Cambridge, UK)
- References: <006301c00147$52d39e40$7601a8c0@borg> <39902767.323846C6@redhat.co.uk>
Jonathan Larmour <jlarmour@redhat.co.uk> writes:
> "Boris V. Guzhov" wrote:
> > >
> > >If you do need to go faster, you can try disabling and enabling
> > >interrupts using cyg_interrupt_disable() and cyg_interrupt_enable().
> > >Since there are only a few instructions involved for code like this,
> > >it is unlikely that the maximum interrupt latency will be affected.
> > >
> > >Alternatively there might be some x86 instructions which will do the
> > >right thing without having to disable interrupts, and which you could
> > >invoke using some inline assembler. It has been quite a while since I
> > >did any x86 assembler programming, I cannot help there.
> >
> > Thanks.
> > I think that the instructions of the CPU interrupts disabling/enabling are
> > available in many CPUs.
> > And it's useful to have HAL macros's for them.
>
> I think the HAL_ENABLE/DISABLE/RESTORE_INTERRUPTS macros in
> hal/i386/pc/VERSION/include/var_intr.h are what you are probably looking
> for here.
>
Bart's suggestion to use the KAPI functions is the correct one. While
at present these are just wrappers for the HAL macros, on other
platforms or in future developments, we may need to do kernel level
things when enabling or disabling interrupts. Using these functions
makes the calling code future proof.
--
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK