Path: utzoo!attcan!uunet!husc6!bloom-beacon!gatech!rutgers!ucsd!ucsdhub!hp-sdd!hplabs!well!brecher From: brecher@well.UUCP (Steve Brecher) Newsgroups: comp.sys.mac.programmer Subject: Re: Multifinder: how do I patch GetNextEvent? Message-ID: <7374@well.UUCP> Date: 14 Oct 88 20:46:11 GMT References: <747@ttrdf.UUCP> <10050025@eecs.nwu.edu> <2456@spray.CalComp.COM> Reply-To: brecher@well.UUCP (Steve Brecher) Organization: Software Supply, Sunnyvale, CA Lines: 34 In article <2456@spray.CalComp.COM>, anson@spray.CalComp.COM (Ed Anson) writes, > As I understand it (now), the only traps which must not be tail patched are > those which: > > 1. Are relatively small, and > 2. Are called from other (bigger) traps. Add: 3. Are patched by Apple to fix bugs using "come from" tests. A "come from" test examines the stack to determine the location of the caller of the trap, e.g. if returnAddress = aParticularROMaddress then doSomethingToFixTheROMbug else jump to original trap code Apple uses this technique to avoid consuming large amounts of RAM for ROM bug fixes; in some cases, without "come from" tests, entire managers would have to be replaced in RAM. A tail patch wipes out the ROM bug fix patch because the return address will never satisfy the test, since by definition a tail patch executes the previous trap code with a JSR. The wish to > ...see the rules modified to something like: > 1. Avoid tail patches, except for the following traps... cannot be granted by Apple until such time as it discovers how to write bug-free ROMs, or how to legally protect its operating system code without resorting to delivering it in ROM.