4545#include <asm/asm - offsets.h>
4646
4747.globl system_call , buserr , trap , resume
48- .globl inthandler , sys_call_table
48+ .globl sys_call_table
4949.globl sys_fork , sys_clone , sys_vfork
5050.globl ret_from_interrupt , bad_interrupt
5151
@@ -191,44 +191,15 @@ do_delayed_trace:
191191 jbra resume_userspace
192192
193193
194- #if 0
195- #ifdef CONFIG_AMIGA
196- ami_inthandler:
197- addql # 1 , irq_st at + CPUSTAT_LOCAL_IRQ_COUNT
198- SAVE_ALL_INT
199- GET_CURRENT(%d0)
200-
201- bfextu % sp @(PT_VECTOR){# 4 , # 12 } , %d0
202- movel %d0 , %a0
203- addql # 1 , %a0@(kst at + STAT_IRQ - VECOFF(VEC_SPUR))
204- movel %a0@(autoirq_list - VECOFF(VEC_SPUR)) , %a0
205-
206- | amiga vector int handler get the req mask instead of irq vector
207- lea CUSTOMBASE , %a1
208- movew %a1@(C_INTREQR) , %d0
209- andw %a1@(C_INTENAR) , %d0
210-
211- | prepare stack ( push frame pointer , dev_id & req mask)
212- pea % sp @
213- movel %a0@(IRQ_DEVID) , % sp @ -
214- movel %d0 , % sp @ -
215- pea %pc@(ret_from_interrupt:w)
216- jbra @(IRQ_HANDLER , %a0)@( 0 )
217-
218- ENTRY(nmi_handler)
219- rte
220- #endif
221- #endif
194+ / * This is the main interrupt handler for autovector interrupts * /
222195
223- / *
224- ** This is the main interrupt handler , responsible for calling process_int()
225- * /
226- inthandler:
196+ ENTRY(auto_inthandler)
227197 SAVE_ALL_INT
228198 GET_CURRENT(%d0)
229199 addqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
230200 | put exception # in d0
231- bfextu % sp @(PT_VECTOR){# 4 , # 10 } , %d0
201+ bfextu % sp @(PT_VECTOR){# 4 , # 10 } , %d0
202+ subw #VEC_SPUR , %d0
232203
233204 movel % sp , % sp @ -
234205 movel %d0 , % sp @ - | put vector # on stack
@@ -241,15 +212,16 @@ inthandler:
241212 jbra 3f
2422131 :
243214#endif
244- jbsr process_int | process the IRQ
215+ jsr m68k_handle_int | process the IRQ
2452163 : addql # 8 , % sp | pop parameters off stack
246217
247218ret_from_interrupt:
248219 subqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
249- jeq 1f
250- 2 :
251- RESTORE_ALL
252- 1 :
220+ jeq ret_from_last_interrupt
221+ 2 : RESTORE_ALL
222+
223+ ALIGN
224+ ret_from_last_interrupt:
253225 moveq #(~ALLOWINT>> 8 )& 0xff , %d0
254226 andb % sp @(PT_SR) , %d0
255227 jne 2b
@@ -260,12 +232,40 @@ ret_from_interrupt:
260232 pea ret_from_exception
261233 jra do_softirq
262234
235+ / * Handler for user defined interrupt vectors * /
236+
237+ ENTRY(mach_inthandler)
238+ SAVE_ALL_INT
239+ GET_CURRENT(%d0)
240+ addqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
241+ | put exception # in d0
242+ bfextu % sp @(PT_VECTOR){# 4 , # 10 } , %d0
243+
244+ movel % sp , % sp @ -
245+ movel %d0 , % sp @ - | put vector # on stack
246+ movel mach_process_int , %a0
247+ jsr %a0@ | process the IRQ
248+ addql # 8 , % sp | pop parameters off stack
249+
250+ subqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
251+ jeq ret_from_last_interrupt
252+ RESTORE_ALL
263253
264254/ * Handler for uninitialized and spurious interrupts * /
265255
266- bad_interrupt:
267- addql # 1 , num_spurious
268- rte
256+ ENTRY(bad_inthandler)
257+ SAVE_ALL_INT
258+ GET_CURRENT(%d0)
259+ addqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
260+
261+ movel % sp , % sp @ -
262+ jsr handle_badint
263+ addql # 4 , % sp
264+
265+ subqb # 1 , %curptr@(TASK_INFO + TINFO_PREEMPT + 1 )
266+ jeq ret_from_last_interrupt
267+ RESTORE_ALL
268+
269269
270270ENTRY(sys_fork)
271271 SAVE_SWITCH_STACK
0 commit comments