2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Exec function Dispatch()
9 /******************************************************************************
12 AROS_LH0(void, Dispatch,
15 struct ExecBase *, SysBase, 10, Exec)
35 ******************************************************************************/
41 .globl AROS_SLIB_ENTRY(Dispatch,Exec)
42 .type AROS_SLIB_ENTRY(Dispatch,Exec),@function
44 AROS_SLIB_ENTRY
(Dispatch
,Exec
):
45 /* Push all registers */
54 /* block all signals */
55 call AROS_CSYMNAME
(os_disable
)
57 /* Get SysBase again */
61 movl ThisTask
(%ecx
),%edx
62 movl
%esp
,tc_SPReg
(%edx
)
65 testb $TF_SWITCH
,tc_Flags
(%edx
)
67 movl tc_Switch
(%edx
),%eax
72 movb IDNestCnt
(%ecx
),%al
73 movb
%al
,tc_IDNestCnt
(%edx
)
74 movb $
-1,IDNestCnt
(%ecx
)
76 /* Get task from ready list */
77 movl TaskReady
(%ecx
),%edx
79 movl
%eax
,TaskReady
(%ecx
)
81 leal TaskReady
(%ecx
),%ebx
83 movl
%edx
,ThisTask
(%ecx
)
85 /* Use as current task */
86 movb $TS_RUN
,tc_State
(%edx
)
87 movb tc_IDNestCnt
(%edx
),%al
88 movb
%al
,IDNestCnt
(%ecx
)
91 cmpb $
0,tc_Flags
(%edx
)
93 movl tc_Launch
(%edx
),%eax
98 movl tc_SPReg
(%edx
),%eax
100 /* Compare agains SPLower */
101 cmpl %eax
,tc_SPLower
(%edx
)
104 /* Compare against SPUpper */
105 cmpl %eax
,tc_SPUpper
(%edx
)
111 pushl $
(AT_DeadEnd|AN_StackProbe
)
112 leal Alert
(%ecx
),%eax
114 /* Function does not return */
119 /* Put the SP into the correct register after checking */
122 /* Unblock signals if necessary */
123 cmpb $
0,tc_IDNestCnt
(%edx
)
126 /* If called from the signal handler don't do it. */
127 cmpl $
0,AROS_CSYMNAME
(supervisor
)
129 call AROS_CSYMNAME
(os_enable
)
132 /* Except bit set? */
133 testb $TF_EXCEPT
,tc_Flags
(%edx
)
136 /* Raise task exception in Disable()d state */
139 /* leal Disable(%ecx),%eax
141 leal Exception
(%ecx
),%eax
144 leal Enable(%ecx),%eax */
148 /* Restore registers and return */