Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Feb 1999 10:02:39 +0100
From:      Eivind Eklund <eivind@FreeBSD.ORG>
To:        Dag-Erling Smorgrav <des@flood.ping.uio.no>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Regarding tcpdump and plip
Message-ID:  <19990212100238.N96008@bitbox.follo.net>
In-Reply-To: <xzpiud8igqv.fsf@flood.ping.uio.no>; from Dag-Erling Smorgrav on Fri, Feb 12, 1999 at 01:54:16AM %2B0100
References:  <xzp90e9brl4.fsf@flood.ping.uio.no> <199902080148.RAA09054@dingo.cdrom.com> <19990208195855.56187@breizh.prism.uvsq.fr> <xzpsocg63t5.fsf@flood.ping.uio.no> <19990208222829.53422@breizh.prism.uvsq.fr> <xzpk8xs5zfm.fsf@flood.ping.uio.no> <19990211225037.40571@breizh.prism.uvsq.fr> <xzpiud8igqv.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 12, 1999 at 01:54:16AM +0100, Dag-Erling Smorgrav wrote:
> (BTW, I wouldn't mind if one of you superhero programmers wrote a
> short introduction to interrupt masks "for the rest of us")

I'll try to get this right, even though it is incomplete, but no
guarantee:

Interrupt masks are, well, interrupt masks.  There are a bit for each
interrupt; this bit control whether the interrupt in question will be
serviced or delayed.

Each of the spl<xxx>()'s has a connected mask, <xxx>_imask.  This mask
contains the actual masks of interrupts that are to be suspended by an
spl<xxx>().

Normally, an interrupt end up in the imask through a register_intr
call - here is an example from the clock code:

        register_intr(/* irq */ apic_8254_intr, /* XXX id */ 0, /* flags */ 0,
                      /* XXX */ (inthand2_t *)clkintr, &clk_imask,
                      /* unit */ 0);
        INTREN(1 << apic_8254_intr);

Note that the cast to inthand2_t seems bogus; inthand_t and inthand2_t
are for taking a void * or an int as an argument to the interrupt
functions.  We're moving from unit numbers to actual softc (soft
configuration) structures.  INTREN() is a macro to enable the
interrupt (in the APIC, I think, but I'm not quite clear on where/how
it is used).  The call that finally register the interrupt is usually
done by the bus controlling code, anyway, so you won't see this.

The imasks is the sole thing that controls which interrupts are
blocked; this is why you sometimes see code like this
     tty_imask |= softnet_imask;     /* spltty() block spl[soft]net() */
(from /sys/net/ppp_tty.c).  Do Not Write Code Like This Unless You
Really, Really Know What You Are Doing.

Note that parts of the registration system will change as we switch to
the new bus architecture - so don't depend too much on how it is done
right now.

Eivind.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990212100238.N96008>