On Fri, 8 Feb 2002, Julian Elischer wrote:

> Bruce, for the low-level impared such as myself, can you give a quick
> precis on teh difference between "fast" interrupt handlers in -current
> and 'normal' interrupt handlers.

"Fast" interrupt handlers are harder to program and should rarely be used.
There are no correctly programmed ones in -current.  A correctly programmed
one would do not much more than something like:

        buf[writeindex++ & mask] = bus_space_read_1(...);

> Do fast interrupt handlers enter through "trap()" ?

No.  They are called directly from XfastintrN.  A really fast one would
be inside XfastintrN.

> if they interrupt a user process, do they take on the cred of the running
> thread?

No.  Accessing almost anothing except correctly locked local (static)
storage in a fast interrupt handler is a bug.

> do they return via doreti()

They always do in -current.  This is a pessimization (never merged
into my version).  In -stable, they can only return via doreti if they
metamorphose into a normal interrupt handler, which they do in most
the few cases where doreti would do something other than just return.
Note that it would only do somthing for return to _user_ mode if the
fast interrupt handler scheduled a software interrupt (no other interrupts
or ASTs can be pending since there must have been none when the fast
interrupt occurred, and fast interrupts disable other interrupts).

> on returning do they check for ASTs and run userret()?

Yes, anything that reaches doreti checks for ASTs and runs userret() if
necessary and possible (only for returns to user mode).

Hmm, this check seems to be inadequate for fast interrupts.  There is
no check for rescheduling if the return is to kernel mode.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to