2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 #include <exec/execbase.h>
7 #include <exec/tasks.h>
8 #include <exec/memory.h>
9 #include <exec/ptrace.h>
11 #include "exec_util.h"
13 BOOL
PrepareContext(struct Task
*task
, APTR entryPoint
, APTR fallBack
,
14 struct TagItem
*tagList
, struct ExecBase
*SysBase
)
17 UBYTE
*sp
= (UBYTE
*)task
->tc_SPReg
;
19 /* Push fallBack address */
21 *(APTR
*)sp
= fallBack
;
23 if (!(task
->tc_Flags
& TF_ETASK
))
25 *(ULONG
*)0x0bad0001=0;
29 task
->tc_UnionETask
.tc_ETask
->et_RegFrame
= AllocTaskMem(task
, SIZEOF_ALL_REGISTERS
,
30 MEMF_PUBLIC
|MEMF_CLEAR
);
32 if (!(regs
= (struct pt_regs
*)task
->tc_UnionETask
.tc_ETask
->et_RegFrame
))
34 *(ULONG
*)0x0bad0003=0;
39 regs
->pc
= (ULONG
)entryPoint
;