make the window layout a little tidier.
[AROS.git] / arch / .unmaintained / m68k-emul / preparecontext.c
blob656113abcc58a7c4c98dbf7643dfbdf0795effe1
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <aros/libcall.h>
9 #include "exec_util.h"
11 #error "PrepareContext() has been changed. Additional tagList param, etc."
12 #error "This one here needs to be rewritten!"
14 BOOL PrepareContext(struct Task *task, APTR entryPoint, APTR fallBack,
15 struct TagItem *tagList, struct ExecBase *SysBase)
17 UBYTE *sp=(UBYTE *)stackPointer;
18 int i;
21 mc68000 version. As long as no FPU is in use this works for the
22 other mc680xx brands as well.
25 /* Push fallback address */
26 sp-=sizeof(APTR);
27 *(APTR *)sp=fallBack;
29 /* Now push the context. Prepare a rts first (pc). */
30 sp-=sizeof(APTR);
31 *(APTR *)sp=entryPoint;
33 /* Push 15 registers */
34 for(i=0;i<15;i++)
36 sp-=sizeof(LONG);
37 *(LONG *)sp=0;
40 return sp;
41 } /* PrepareContext */