home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!camex!lloyd!kent
- From: kent@lloyd.Camex.COM (Kent Borg)
- Subject: Re: Proper way to do Self-Modifying code?
- Message-ID: <1993Jan05.163138.20910@lloyd.Camex.COM>
- Organization: Camex Inc., Boston MA
- References: <wfFp_jO00WB707kGgq@andrew.cmu.edu> <1993Jan4.120353.16699@kth.se>
- Date: Tue, 05 Jan 1993 16:31:38 EST
- Lines: 33
-
- In article <1993Jan4.120353.16699@kth.se> d88-jwa@dront.nada.kth.se (Jon WΣtte) writes:
- >In <wfFp_jO00WB707kGgq@andrew.cmu.edu> at15+@andrew.cmu.edu (Andrew Lewis Tepper) writes:
- >
- >>Is there an accepted way to do this on the Mac? I know that
- >>self-modifying code can cause problems on chips with caches, so I want
- >>to be as "kosher" as possible.
-
- I hate being non-Kosher, but just today some of my code was modifying
- itself. (How can a proc in the sleep queue find my A5 world anyway?)
-
- My "to do" list said I should check before I trap, so I added:
-
- > if ( TrapAvailable ( _HwPriv ) ) {
- >
- > /* FIC also calls FlushDataCache */
- > FlushInstructionCache ( ) ;
- > }
-
- It didn't work.
-
- At least with my .h-files, the spelling is "HWTrap". (And now I need
- to type in the source for TrapAvailable()--now I remember why I didn't
- do this before.)
-
- Yes, trivial, so instead consider my post as follows: How should one
- find one's A5 world from within a sleep queue procedure?
-
-
- --
- Kent Borg kent@camex.com or kentborg@aol.com (when it is *working*)
- H:(617) 776-6899 W:(617) 426-3577
- As always, things look better when some costs are left out.
- -Economist 3-28-92 p. 94
-