2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Signal handler for Linux/m68k
15 #define FirstArg 4+(2*4)
16 #define signum FirstArg+0
17 #define code FirstArg+4
22 .globl AROS_CDEFNAME(linux_sighandler)
23 .type AROS_CDEFNAME(linux_sighandler),@function
24 AROS_CDEFNAME
(linux_sighandler
):
26 movem.
l %a5-
%a6
,-(%sp
)
28 lea
(%pc
,_GLOBAL_OFFSET_TABLE_@GOTPC
),%a5
29 movea.
l supervisor@GOT
(%a5
),%a0
34 /* Already in signal handler... Not good */
38 /* Increase supervisor count */
40 /* Call the Amiga interrupt server for this signal */
41 move.
l signum
(%sp
),-(%sp
)
43 bsr.
l AROS_CSYMNAME
(call_inthandlers
)@PLTPC
45 jbsr AROS_CSYMNAME
(call_inthandlers
)
49 movea.
l SysBase@GOT
(%a5
),%a1
58 /* Dispatch pending? */
59 btst
#7,AttnResched(%a6)
62 bclr #7,AttnResched(%a6)
64 /* If there's no current task, we don't need to save
66 movea.
l ThisTask
(%a6
),%a1
68 /* Don's save the registers if the task was removed,
69 it will never get to run again. */
70 cmp.
b #TS_REMOVED,tc_State(%a1)
73 move.
l sc_usp
(%a0
),tc_SPReg
(%a1
)
74 movea.
l tc_UnionETask
(%a1
),%a1
75 movea.
l iet_Context
(%a1
),%a1
76 /* Save all registers in
77 SysBase->ThisTask->tc_UnionETask->iet_Context */
91 movem.
l (%sp
)+,%a5-
%a6
92 movem.
l %d2-
%d7
/%a2-
%a6
,regs
(%a1
)
93 movem.
l %a5-
%a6
,-(%sp
)
94 fmovem.x
%fp2-
%fp7
,fpregs
(%a1
)
96 lea
(%pc
,_GLOBAL_OFFSET_TABLE_@GOTPC
),%a5
97 movea.
l SysBase@GOT
(%a5
),%a6
103 /* Call Dispatch() to do its work */
106 bsr.
l AROS_CSYMNAME
(Dispatch
)@PLTPC
108 jbsr AROS_CSYMNAME
(Dispatch
)
111 # if !UseRegisterArgs
115 # if !UseRegisterArgs
119 /* We have switched tasks, restore the registers */
120 movea.
l ThisTask
(%a6
),%a1
121 movea.
l tc_UnionETask
(%a1
),%a1
122 movea.
l iet_Context
(%a1
),%a0
124 /* Is this the first time? */
140 fmovem.x fpregs
(%a0
),%fp2-
%fp7
143 move.
l sc_d0
(%a0
),sc_d0
(%a1
)
144 move.
l sc_d1
(%a0
),sc_d1
(%a1
)
145 move.
l sc_a0
(%a0
),sc_a0
(%a1
)
146 move.
l sc_a1
(%a0
),sc_a1
(%a1
)
147 move.
l sc_pc
(%a0
),sc_pc
(%a1
)
149 movem.
l regs
(%a0
),%d2-
%d7
/%a2-
%a6
151 movem.
l %a5-
%a6
,-(%sp
)
153 lea
(%pc
,_GLOBAL_OFFSET_TABLE_@GOTPC
),%a5
154 movea.
l SysBase@GOT
(%a5
),%a0
159 move.
l ThisTask
(%a6
),%a0
160 move.
l tc_SPReg
(%a0
),sc_usp
(%a1
)
161 /* Are interrupts enabled or disable for this task? */
165 move.
l %d0
,sc_mask
(%a1
)
170 /* Is there an exception to be processed? */
172 btst
#TB_EXCEPT,tc_Flags(%a0)
174 # if !UseRegisterArgs
180 # if !UseRegisterArgs
187 movea.
l supervisor@GOT
(%a5
),%a0
191 /* Decrease supervisor nest count */
194 bset
#15,SysFlags(%a6)
197 movem.
l (%sp
)+,%a5-
%a6