Xref: news2.mv.net comp.os.msdos.djgpp:5149 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Structured index of the FAQs? Date: Tue, 18 Jun 1996 17:48:42 +0100 Organization: The University of York, UK Lines: 29 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <31c6ae92.sandmann@clio.rice.edu> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Tue, 18 Jun 1996, Charles Sandmann wrote: > > It seems that, using go32_dpmi_set_protected_mode_interrupt_vector, > > reetrance is not allowed... Is there a solution? > > Yes, re-write the interrupt wrapper code, or don't use it. You could > write your interrupt routines in assembler and stay on the locked 4K > stack, or you need to write code to handle multiple interrupt stacks. > Non-trivial in either case. Certainly not a two minute sort of question. It's non-trivial, but it can be done. I ran into this problem with Allegro a while back, and ended up implementing my own wrappers that use multiple stacks. It's not _that_ hard, if you keep your wits about you (and was particularly easy in my case because Marcel de Kogel wrote most of the tricky stuff for me :-) In any case, you could save yourself the hassle of reimplementing this by grabbing the files irq.c and irq_wrap.s from Allegro. They provide a similar set of irq wrappers to the libc functions, but handler reentrancy, plus you can dynamically control whether to iret or chain to the old handler by the return value from your C function. /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */