Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.programmer Subject: Re: Can you use Signal() from an input handler? Message-ID: <1991May4.193801.30388@kuhub.cc.ukans.edu> Date: 4 May 91 19:38:01 CDT References: <2032@ria.ccs.uwo.ca> Followup-To: comp.sys.amiga.programmer Organization: University of Kansas Academic Computing Services Lines: 52 > I want to send a signal from the handler to the main program using > Signal(), so that the main program can do some DOS stuff. > - The Task pointer (pointing to the main program) and a > pre-AllocSignal()-ed signal bitnumber are passed to the handler > in it's data area.(The data area isn't used otherwise,in this handler.) > > So far so good. Using kprintf's to a serial terminal I know things > are getting passed OK. But el GURU visits as soon as the Signal() function > is called in the handler. Signal() is kosher in an interrupt. The trick is, if your handler is in C, and if you are in a small data addressing scheme, then your library base isn't automatically addressable by the handler. Under SAS, either: -compile the module with the handler with -y -use the __saveds keyword (I've had some problems mixing mulitple keywords on functions though) on the function. -call geta4(); as the first line of the function. This is isn't a problem with 32 bit absolute addressing. Speaking of near/far, in this example, things wouldn't be a problem if the library base pointer *itself* was far data, but I cant figure out in SAS the way to declare pointers with the far keyword to put the pointer storage itself far, I always get a pointer to a far object. On DOS I can do something like this: (assume Near data model is default): // sizeof(foo) = 2 far footype *foo; // foo is near ptr located in far data segment // sizeof(foo) = 4 footype far *foo; // foo is far ptr located in default DS // sizeof(foo) = 4 far footype far *foo; // foo is far ptr in far data segment. //OOPs, too much C++ ;-) But SAS croaks unless far comes after the type, which means always modifies the kind of pointer it is, not where it goes. Granted ANSI says modifiers must come after the type, but that makes it tough to do things like this. DOS compilers bend the rule, since esp. on DOS the three proceeding situations are quite different, and you may want all three. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum Only... \ Good Cheer !!! Academic Computing Services /// \___________________________ University of Kansas /// /| __ _ Bix: mgooderum \\\ /// /__| |\/| | | _ /_\ makes it Bitnet: MARKV@UKANVAX \/\/ / | | | | |__| / \ possible... Internet: markv@kuhub.cc.ukans.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~