Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / arch / i386-darwin / exec / preparecontext.c
blobb6bcf0cea6312b656926743553f20cbec286bc8c
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: i386unix version of PrepareContext().
6 Lang: english
7 */
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>
15 #include "etask.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!
23 #endif
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)
36 AROS_LIBFUNC_INIT
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) )
41 return FALSE;
43 GetIntETask (task)->iet_Context = AllocTaskMem (task
44 , SIZEOF_ALL_REGISTERS
45 , MEMF_PUBLIC|MEMF_CLEAR
48 if (!GetIntETask (task)->iet_Context)
49 return FALSE;
52 KRNWireImpl(PrepareContext);
54 CALLHOOKPKT(krnPrepareContextImpl,task,TAGLIST(TAG_USER,entryPoint,TAG_USER+1,fallBack,TAG_USER+2,tagList,TAG_DONE));
56 return TRUE;
58 AROS_LIBFUNC_EXIT