Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ncar!asuvax!mcdphx!teroach.UUCP!dbk From: dbk@teroach.UUCP (Dave Kinzer) Newsgroups: comp.sys.amiga Subject: Re: Whats wrong with self Modifying Code? Summary: Lots, but that's not the point here. Keywords: Cache, of course Message-ID: <13203@mcdphx.phx.mcd.mot.com> Date: 15 Jul 90 02:57:05 GMT References: <6180@helios.ee.lbl.gov> <31727@cup.portal.com> Sender: listen@mcdphx.phx.mcd.mot.com Reply-To: dbk@teroach.UUCP (Dave Kinzer) Followup-To: comp.sys.amiga Distribution: na Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 34 In article <31727@cup.portal.com> Sullivan@cup.portal.com (sullivan - segall) writes: >The 68040 snoops the address bus for writes to cached memory, and updates >the cache it is sees any. (I.e: you shouldn't ever have to flush the >cache on any processor >= 68040.) BZZZZZZZZZZZZZZT! Sorry, but we have some lovely parting gifts... That the 68040 snoops anything it sees on the bus is true, the problem is that all the blitter (and possibly other DMA in different configurations) activity is hidden from the processor (allowing the processor do to other things.) The correct answer is that anytime, and that means ANYTIME, the memory is loaded with instructions, the cache needs to be flushed. This should be a system call since the application program usually should know nothing about the processor executing its code, with the system call handling the individual system requirements. I tried to find one in my 1.2 docs (I thought I remembered one), but failed. For 2.0, I expect "It's in there." I left enough hints here that I wanted it. More years ago than I care to remember, I had an instructor point out that all we had ever written was self modifying code. Now this instructor drilled us through the many courses we had taken that this was a definate no no, and I had never stooped so low as to do it, so I was taken aback by this statement. What do you mean, self modifying? None of our programs would have passed! The point of view he was taking was that of the operating system, and that when our program was read into system memory, the system's code was modified. This subtile point was never lost on me. The system, of course, flushed the cache after loading (if so equiped.) You should too. * * * Imminent use of deathnet predicted. * * * // Dave Kinzer (602)897-3085 asuvax!mcdphx!teroach!dbk Opinions are mine. \X/