2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Run a process ( invoked by dos/Runcommand() )
7 LONG RunProcess ( struct Process * proc,
8 struct StackSwapStruct * sss,
12 struct DosLibrary * DOSBase
18 FirstArg
= 4+(2*4) /* Return-address + registers */
28 .globl AROS_SLIB_ENTRY(RunProcess,Dos)
29 .type AROS_SLIB_ENTRY(RunProcess,Dos),@function
30 AROS_SLIB_ENTRY
(RunProcess
,Dos
):
31 movem.
l a5-a6
,-(sp
) /* Save some registers */
33 move.
l sss
(sp
),a0
/* Fetch the arguments off the stack */
34 move.
l entry
(sp
),a5
/* " " " " " " */
36 move.
l stk_Upper
(a0
),a1
/* Move upper bounds of the new stack into a1 */
37 move.
l a0
,-(a1
) /* Push sss onto the new stack */
38 move.
l DOSBase
(sp
),a6
/* Get SysBase */
39 move.
l dl_SysBase
(a6
),a6
/* " " */
40 move.
l a6
,-(a1
) /* Push SysBase onto the new stack */
41 move.
l a1
,stk_Pointer
(a0
) /* Store Switch Point in sss */
43 jsr StackSwap
(a6
) /* Switch stacks (a0=sss) */
45 jsr
(a5
) /* Call the specified routine */
46 move.
l d0
,a5
/* Save return value */
48 move.
l (sp
)+,a6
/* Pop SysBase off the new stack */
49 move.
l (sp
)+,a0
/* Pop sss off the new stack */
50 jsr StackSwap
(a6
) /* Switch stacks back */
52 move.
l a5
,d0
/* Put result in d0 where our caller expects it */
54 movem.
l (sp
)+,a5-a6
/* Restore registers */