2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id: dispatch.s 12742 2001-12-08 18:32:01Z chodorowski $
5 Desc: Exec function Dispatch()
9 /******************************************************************************
12 AROS_LH0(void, Dispatch,
15 struct ExecBase *, SysBase, 10, Exec)
35 ******************************************************************************/
40 .balign 32 /* twice align of i386??? */
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 */
62 /* block all signals */
63 call AROS_CSYMNAME
(os_disable
)
65 /* Get SysBase again */
69 mov ThisTask
(%rcx
),%rdx
70 mov
%rsp
,tc_SPReg
(%rdx
)
73 testb $TF_SWITCH
,tc_Flags
(%rdx
)
75 mov tc_Switch
(%rdx
),%rax
80 movb IDNestCnt
(%rcx
),%al
81 movb
%al
,tc_IDNestCnt
(%rdx
)
82 movb $
-1,IDNestCnt
(%rcx
)
84 /* Get task from ready list */
85 mov TaskReady
(%rcx
),%rdx
87 mov
%rax
,TaskReady
(%rcx
)
89 lea TaskReady
(%rcx
),%rbx
91 mov
%rdx
,ThisTask
(%rcx
)
93 /* Use as current task */
94 movb $TS_RUN
,tc_State
(%rdx
)
95 movb tc_IDNestCnt
(%rdx
),%al
96 movb
%al
,IDNestCnt
(%rcx
)
99 cmpb $
0,tc_Flags
(%rdx
)
101 mov tc_Launch
(%rdx
),%rax
106 mov tc_SPReg
(%rdx
),%rax
108 /* Compare agains SPLower */
109 cmp %rax
,tc_SPLower
(%rdx
)
112 /* Compare against SPUpper */
113 cmp %rax
,tc_SPUpper
(%rdx
)
119 push $
(AT_DeadEnd|AN_StackProbe
)
122 /* Function does not return */
127 /* Put the SP into the correct register after checking */
130 /* Unblock signals if necessary */
131 cmpb $
0,tc_IDNestCnt
(%rdx
)
134 /* If called from the signal handler don't do it. */
135 cmp $
0,AROS_CSYMNAME
(supervisor
)
137 call AROS_CSYMNAME
(os_enable
)
140 /* Except bit set? */
141 testb $TF_EXCEPT
,tc_Flags
(%rdx
)
144 /* Raise task exception in Disable()d state */
147 /* leal Disable(%rcx),%rax
149 lea Exception
(%rcx
),%rax
152 lea Enable(%rcx),%rax */
156 /* Restore registers and return */