home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20783 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.6 KB  |  44 lines

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