home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os9
- Path: sparky!uunet!mcrware!dibble
- From: dibble@microware.com (Peter Dibble)
- Subject: Re: PROBLEM with my IRQ routines
- Message-ID: <1993Jan27.193853.27880@microware.com>
- Sender: news@microware.com
- Nntp-Posting-Host: seldon
- Organization: Microware Systems Corp., Des Moines, Iowa
- References: <105860@netnews.upenn.edu>
- Date: Wed, 27 Jan 1993 19:38:53 GMT
- Lines: 42
-
- In article <105860@netnews.upenn.edu> mark@ginger.biophys.upenn.edu (Mark Elliott) writes:
- >---------------------THE QUESTION-----------------------------------------------
- > Does anyone know how an Interrupt Service Routine loaded in the IRQ
- >table can find out the vector number of the interrupt which caused it to be
- >invoked?
- >--------------------------------------------------------------------------------
- >As it is now, I have as many ISRs as I do
- >boards, all of them almost identical.
- >---------------------------------------------------------------------------------
- >
- >Mark Elliott |
-
- The information you want is on the stack.
- The hardware puts the vector number in the interrupt stack frame
- if you are using something more recent than a 68000, and the jump
- table puts it on the stack for any processor.
- Although the information you want is there, I recommend that you don't
- look for it. That kind of thing is undocumented and very subject to change.
-
- You can improve your situation a lot with a little bit of entirely
- "front door" trickery.
-
- Continue to set up a separate ISR for each vector, but do very little
- before you enter common code that is shared between all the devices.
- The most space-efficient way I know to do this is:
-
- ISR1: addq.l #4,a3 kick port address
- ISR2: addq.l #4,a3 kick port address
- ISR3: addq.l #4,a3 kick port address
- ISR4: addq.l #4,a3 kick port address
- ISR5: addq.l #4,a3 kick port address
- ISR6: addq.l #4,a3 kick port address
- ISR7: common code
-
- There'll be a loop somewhere else that F$IRQ's all 7 ISRs.
-
- This is a bit space inefficient, but if the difference between
- your devices is just their port address, or something you can express
- in small amounts of static storage, it will let you fold a bunch of
- interrupt service routines into one with little overhead.
-
- Peter
-