Subject: Re: IREENT_MAGIC
To: =?ISO-8859-1?Q?Edgar_Fu=DF?= <firstname.lastname@example.org>
From: Frank van der Linden <email@example.com>
Date: 03/22/2007 21:28:12
Edgar Fuß wrote:
> Could someone please enlighten me how IREENT_MAGIC is supposed to work?
> I guess this is to prevent re-enabling an interrupt when returning
> from a nested one.
It's part of the soft interrupt masking scheme that the i386 port and
the amd64 port use. In splx(), the code may discover that some
interrupts have been deferred, so it calls them by hand, faking an
actual interrupt stack frame. The error part of the frame is unused, and
is, in this case, abused to be able to recognize that you're not in a
'real' interrupt context, but in a faked one. This is useful for DDB
backtraces, for example.