Subject: Re: CG6 and serial port support questions
To: None <brian@timur.eric.on.ca, port-sparc@NetBSD.ORG>
From: Chris Torek <torek@bsdi.com>
List: port-sparc
Date: 03/20/1996 13:06:15
>... every time an interrupt for the port has to be handled, a Sun3 has
>to save 24 registers in the CPU, whereas the Sparc must save 192 ...

Actually, the number of registers saved depends on the `save' depth:
one for the trap, one for the call to zshard(), and one for calls
from zshard() to any non-leaf routine (or any routine for which gcc
chooses to emit a `save'), and so on.  Multiply the deepest save-chain
by 16 to get the number of registers saved.  If the chain goes deeper
than 6 or 7 (depending on which CPU implementation you have), the
picture worsens, but this is unlikely.

The saves occur only if the register windows are full, which is true
some percentage of the time depending on the number of windows in the
CPU and other more-or-less random factors.

Each window save can cost over a hundred cycles, so cutting the
number of saves is important, whenever possible.

Ideally, the zs hardware interrupt handler should be written to
run entirely within the trap window (see the audio interrupt handler
for an example).  This is nontrivial, and would require moving L1-A
and `break' handling to zssoft() (or some rather tricky coding to
do L1-A a la a `regular' interrupt).  I believe SunOS does L1-A and
break aborts in the software handler, but does not use a trap-window
hardware handler.

Chris