Subject: Re: Interesting observation in if_mc_obio.c
To: Dave Huang <khym@azeotrope.org>
From: Michael R. Zucca <mrz5149@acm.org>
List: port-mac68k
Date: 12/16/2001 13:38:40
At 4:25 PM -0500 12/15/01, Dave Huang wrote:
>Hmm, I'll see if I still have my original disassembly around anywhere;
>it's been a few years :) The hard drive that I know it was on has died,
>but I may have a copy elsewhere...

It might be worth it. Here's an example of the code I was working on.

ResEdit code editor produced this:

Anon3
+0000  000072  ORI.B	#$0828,D0	; '('	 	| 0000 0828
+0004  000076  ORI.B	 #$08,A0			 	| 0008 0008
+0008  00007A  BEQ.S	Anon3+$0002	; 00000074	| 67F8

This code, at first glance (i.e. ignoring the +0002, which is an easy
mistake to make), looks like its doing a complicated check of the top byte
of the DMA register set's address register.

However this is deceiving because all references to this code branch to
Anon3+0002 so this code _actually_ looks like this:

+0002 000074 BTST		#$08,$0008(A0)			| 0828 0008
0008
+0008 000074 BEQ.S	Anon3+$0002	; 00000074	| 67F8

Which changes the way this code works. It is actually checking a bit the
DMA register set's command register.

I would imagine something similar is happening in the if_mc_obio code. It's
probably checking the command register or something waiting for the DMA
engine to come to a complete halt before proceeding.

Hope you can find the code. If not, I've got an AV I'm working on here. I
can get you a dump of whatever you like.

____________________________________________________________________
 Michael Zucca - mrz5149@acm.org
 "I will choose a path that's clear. I will choose Freewill. "
  --Rush, Freewill
____________________________________________________________________