Message-Id: <199703181644.RAA19866@math.amu.edu.pl> Comments: Authenticated sender is From: "Mark Habersack" Organization: PPP (Pesticide Powered Pumpkins) To: "Michael D. McDonnell" , djgpp AT delorie DOT com Date: Tue, 18 Mar 1997 17:38:28 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Stack Switching in Isr's Reply-to: grendel AT hoth DOT amu DOT edu DOT pl In-reply-to: <332DC64B.7232@concentric.net> On 17 Mar 97 (at 14:31) Michael D. McDonnell became famous by saying: > In a real-time multi-threaded system it is sometimes desirable to > to switch stacks from within an isr so that the > the "iret" instruction will return to a higher priority > thread. This is a simple matter under DOS, but DPMI seems > to pose various obstacles. Is there a clean solution? Actually, there is. I'm attaching the code which does just that - it switches stacks (and more). The code was written with something different in mind but you (and others, of course) may find it useful. To compile the code and a test application, you must have installed the following DJGPP components (from v2.01): make 3.75+ objdump 2.7+ gas 2.7+ sed 1.18+ and of course DJGPP itself ;-)) make the project with TEST=1 to create a test app. Good luck! **************************************************************** You ask for my love on a strength of a kiss, But can't you just play for experience? I'm a poet, I'm a minstral, I don't need your chains Romance lies in ruin, let debauch you bewail, let it rain...