2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: i386unix version of PrepareContext().
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <exec/memory.h>
12 #include <utility/tagitem.h>
13 #include <proto/kernel.h>
14 #include <aros/kernel.h>
16 #include "exec_util.h"
18 #include <aros/libcall.h>
19 #include <proto/arossupport.h>
21 #ifdef SIZEOF_ALL_REGISTERS
22 #warning SIZEOF_ALL_REGISTERS already defined!
24 #undef SIZEOF_ALL_REGISTERS
26 /* bit awkward, until I can include sigcore.h */
27 #define SIZEOF_ALL_REGISTERS 568
29 AROS_LH4(BOOL
, PrepareContext
,
30 AROS_LHA(struct Task
*, task
, A0
),
31 AROS_LHA(APTR
, entryPoint
, A1
),
32 AROS_LHA(APTR
, fallBack
, A2
),
33 AROS_LHA(struct TagItem
*, tagList
, A3
),
34 struct ExecBase
*, SysBase
, 6, Exec
)
38 kprintf("[PrepareContext] preparing task \"%s\" entry: %p fallback: %p\n",task
->tc_Node
.ln_Name
,entryPoint
,fallBack
);
40 if (!(task
->tc_Flags
& TF_ETASK
) )
43 GetIntETask (task
)->iet_Context
= AllocTaskMem (task
44 , SIZEOF_ALL_REGISTERS
45 , MEMF_PUBLIC
|MEMF_CLEAR
48 if (!GetIntETask (task
)->iet_Context
)
52 KRNWireImpl(PrepareContext
);
54 CALLHOOKPKT(krnPrepareContextImpl
,task
,TAGLIST(TAG_USER
,entryPoint
,TAG_USER
+1,fallBack
,TAG_USER
+2,tagList
,TAG_DONE
));