Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!fuug!news.funet.fi!ra!rosenber From: rosenber@ra.abo.fi (Robin Rosenberg INF) Newsgroups: comp.sys.amiga.programmer Subject: Re: Help! (AmigaDOS CreateProc/LoadSeg) Message-ID: Date: 13 Mar 91 12:40:39 GMT References: <63329@eerie.acsu.Buffalo.EDU> <19578@cbmvax.commodore.com> <06417.AA06417@babylon.rmt.sub.org> <06533.AA06533@babylon.rmt.sub.org> Sender: rosenber@ra.abo.fi Organization: Abo Akademi University, Finland Lines: 29 In-reply-to: rbabel@babylon.rmt.sub.org's message of 11 Mar 91 19:23:12 GMT In article <06533.AA06533@babylon.rmt.sub.org> rbabel@babylon.rmt.sub.org (Ralph Babel) writes: >In article , >rosenber@ra.abo.fi (Robin Rosenberg INF) writes: >> I have a slightly different version, that does not contain >> self-modifying code. Instead of patching the jump >> instrction, I patch data for the instruction. This code is >> of course not reentrant. >Not being reentrant is kind of ugly, of course, but I see >two more potential problems: Static structures are not >necessarily longword-aligned (at least with SAS/C 5.10a), >and - structures usually being located in a data hunk - a >future version of LoadSeg() _could_ selectively clear the >code cache only for the address ranges of the code hunks >just loaded, not data and bss - a useful optimization for >very big caches. This is purely fictitious, of course. Not being reentrant only means that you have to think about where it is being used. Neither does it matter whether the structure is longword aligned or not. Word alignment is sufficient for any 680xx processor. And that is guaranteed by all Amiga compilers. It was pointed out in another posting (by Kristian Nielsen) that I doing unnecessary work. The simpler solution is to have a fake segment fully initialized at compile time, per process entry function. I think I will go with that version instead. Should be clean in any way as long as we are allowed to executed code from a data segment Robin