Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!kth!draken!tut!santra!kampi.hut.fi!jmunkki From: jmunkki@kampi.hut.fi (Juri Munkki) Newsgroups: comp.sys.mac.programmer Subject: Re: Re: Legal Tail Patches Message-ID: <19886@santra.UUCP> Date: 22 Feb 89 13:41:40 GMT References: <1285@ccnysci.UUCP> <10050076@accuvax.nwu.edu> Sender: news@santra.UUCP Reply-To: jmunkki@kampi.hut.fi.UUCP (Juri Munkki) Organization: Helsinki University of Technology, Finland Lines: 31 In article <10050076@accuvax.nwu.edu> bob@accuvax.nwu.edu (Bob Hablutzel) writes: >Are Apple people the only people blessed to do come-from patches? Yes. I would never write a come-from patch even if I knew it was allowed. The problem is that come-from patches prevent tail-patching. There is a rather complicated way in which apple could allow tail-patching while still doing their own come-from patching. Apple could change SetTrapAddr aj GetTrapAddr so that the actual trap dispatch table is not changed for the come-from patched traps, but the current patch is "told" that someone wants to patch it. The come-from patch could then still do the come-from stuff and it could then safely jsr/jmp to the patched routine. GetTrapAddr should return the address that the come-from patch calls. This way no one will loose, but programmers will be allowed to do tail patching. To illustrate: Before patching After patching _______________ ______________ Program calls a trap Program calls a trap Trap dispatcher calls routine Trap dispatcher calls routine Come-from patch does something Come-from patch does something Come-from patch calls ROM Come-from patch calls new patch. New patch calls ROM... Apple: Please implement this in the next system release... _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ | Juri Munkki jmunkki@hut.fi jmunkki@fingate.bitnet I Want Ne | | Helsinki University of Technology Computing Centre My Own XT | ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^