Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: one last word on my simple device problem Message-ID: <8712242040.AA01446@cory.Berkeley.EDU> Date: 24 Dec 87 20:40:21 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 62 :In article <8712241144.AA26621@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes: :> The reply port is actually :> supplied by the device driver (I think.. at least it is NOT supplied :> by the DoIO() function, and NOT by the user, so that leaves the :> device driver!) : :This give me a real uncomfortable feeling inside. I'm not so sure that the :use doesn't need to provide a ReplyPort for requests that are started using :DoIO(). For all of the sample device drivers I've seen, as well as the :diddly drivers that I've written, it sure seems that the user has to provide :the port. : :In fact, the device can't provide its own internal reply port for DoIO() to :use. This is because the device doesn't know if he was called by DoIO(), or :if the user decided to just do a BeginIO on his own with the QUICKIO flag :set. : You are right... it looks like DoIO() needs a reply port! The DoIO() ROM code itself makes an access through the replyport field without checking to see if it is NULL first: ? DoIO() move.l a1,-(a7) move.b #1,1e(a1) set IOF_QUICK move.l a6,-(a7) movea.l 14(a1),a6 jsr -1e(a6) call device driver movea.l (a7)+,a6 movea.l (a7)+,a1 btst #0,1e(a1) check IOF_QUICK bne.s done2 if still set, DONE move.l a2,-(a7) ?u movea.l a1,a2 movea.l e(a2),a0 A0=reply port move.b f(a0),d1 D1=sig bit moveq #0,d0 bset d1,d0 Disable() loop cmpi.b #7,8(a2) nt_Type.. has request been returned? beq.s done Wait() Wait ?u bra.s loop Loop. UnLink() Unlink request Enable() Re-enable done: movea.l (a7)+,a2 done2: move.b 1f(a1),d0 error field in request ext.w d0 ext.l d0 rts P.S. I simplified the disassembly... All the calls except Wait() are actually in-line code. -Matt