[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ethernet not so good.

> > For example, every time a real slot int is triggered, the contents of VIA2
> > Register B (is that the right register? I can't remember) can be saved in a
> > variable, then the VIA1 int handler could run a line like 'if
> > (last_slot_ints & ~handled_slot_ints) poll_slot_ints();' and avoid running
> > through a bunch of unnessacary code a million and a half times.
> Considering the nubus interrupt check is more or less one if() statement
> in the no-irq case i'm not sure it's worth the extra complexity. I'd have
> to check on this part but we should at least be checking via2b directly
> from the via1_irq handler and not dispatching through to via_nubus_irq
> unless necessary. That would at least keep the counters from running up.
> Hmm on actually checking the 2.3 cvs code we are blindly calling
> via_nubus_irq() on every iteration, not to mention three other functions
> at the same time....i'll have to fix that. Stay tuned.

I hadn't even noticed the insane high slot interrupt count :-) But then,
I've not looked at the code since way before the interrupt rewrite, and
didn't know you came up with that trick. Does it help in the VBL interrupt
case (for example)? Or does the machine then drown in Nubus interrupts it
doesn't have a clue how to handle? You'd really have to check the VIA2
IFR, read the slot int bits and mask off the non registered ones to avoid
unneccesary calls to via_do_nubus(). A small inline function should do it:

int via_check_slotint() {

	if ( (via_read(via2, V_IFR) & V_IFR_SLOT) 
	    && (~via_read(via2, V_DATAB) & slot_active) )
		return 1

	return 0

(you know what these V_ constants are really called) 

Speaking of interrupt stuff: The check for 'if no ADB interrupt pending in
the VIA1 IFR, return' at the start of the IIsi ADB interrupt engine seems
a bit silly. As far as I can see, the VIA1 IFR just got cleared before the 
handler gets called in via1_irq? How can this work? 


        if (!(via[IFR] & SR_INT)) {
                /* Shouldn't happen, we hope */
                printk(KERN_DEBUG "maciisi_interrupt: called without
interrupt flag set\n");


        for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
                if (events & irq_bit) {
                        via_write(via1, vIER, irq_bit);
                        via_write(via1, vIFR, irq_bit);
                        mac_do_irq_list(VIA1_SOURCE_BASE + i, regs);
                        via_write(via1, vIER, irq_bit | 0x80);

(In case it didn't work: don't feel silly, Alan had used the same trick in
the MacII ADB code.)

> > Or maybe I should just stop thinking about the whole slot int mess and put
> > a few more pins in my special collectors edition Apple engineers voodoo
> > doll set...
> Not a bad idea in any case. Level-triggered interrupts without a
> forced-acknowledge capability...grrr.

Care to post instructions on how to make your own Apple engineer voodoo


Reply to: