Re: definition of soft/hard interrupts.

2005-03-28 Thread Lowell Gilbert
Bahadir Balban [EMAIL PROTECTED] writes:

 In The design and implementation of 4.4BSD, the execution of

I'm not sure this affects any of your particular questions, but that
book is definitely outdated at this point...

 workqueues, some timer events and scheduling are referred to as
 software interrupts, as well as system calls. I thought only system
 calls would be in soft interrupt category as they are initiated with
 a software interrupt instruction.

A software interrupt actually has its own process context that runs
within the lower half of the kernel.  Device interrupts are usually
handled by packaging the event and passing it to a software interrupt
context for handling.  I don't think it has to be implemented with a
CPU software interrupt instruction.

 By my definition, a hardware interrupt is one that is notified by the
 interrupt controller, and to my knowledge, timer events are hardware
 interrupts. Am I wrong?

 There's also a softclock and hardclock defined. It is as if, an
 interrupt handler for an interrupt reported on the controller, is
 termed as hard, but a low-priority workqueue initiated by a later
 timer event is called as a software interrupt here. The distinction
 here mainly being made by their priority. Would you confirm this?

That's correct, but there are a couple of additional details that
might make it more clear.  Those software interrupts can be scheduled
by other device interrupts as well -- the canonical example is a
hard interrupt servicing a network interface card by setting up the
received packet for the software interrupt to handle later, and then
re-enabling the card for the next packet.  

 In my opinion this isn't the way to put it and software interrupts
 should only mean interrupts initiated by interrupt instructions.

I suspect the usage dates to before the invention of software
interrupt opcodes.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


definition of soft/hard interrupts.

2005-03-27 Thread Bahadir Balban
Hi,

In The design and implementation of 4.4BSD, the execution of
workqueues, some timer events and scheduling are referred to as
software interrupts, as well as system calls. I thought only system
calls would be in soft interrupt category as they are initiated with
a software interrupt instruction.

By my definition, a hardware interrupt is one that is notified by the
interrupt controller, and to my knowledge, timer events are hardware
interrupts. Am I wrong?

There's also a softclock and hardclock defined. It is as if, an
interrupt handler for an interrupt reported on the controller, is
termed as hard, but a low-priority workqueue initiated by a later
timer event is called as a software interrupt here. The distinction
here mainly being made by their priority. Would you confirm this?

In my opinion this isn't the way to put it and software interrupts
should only mean interrupts initiated by interrupt instructions.

All this is mentioned in pp. 56-57 in the book and extends to other parts.

Many thanks for reading,
Bahadir
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]