revert between 56095 -> 55830 in arch
[AROS.git] / arch / arm-all / kernel / createcontext.c
blob5073f892843e1ff1ce120436340b01809ae0a9a3
1 /*
2 Copyright � 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Create an empty usable CPU context, ARM version.
6 Lang: english
7 */
9 #include <aros/kernel.h>
10 #include <aros/libcall.h>
12 #include <aros/arm/cpucontext.h>
14 #include <kernel_base.h>
15 #include <kernel_objects.h>
17 AROS_LH0(void *, KrnCreateContext,
18 struct KernelBase *, KernelBase, 18, Kernel)
21 AROS_LIBFUNC_INIT
23 struct ExceptionContext *ctx;
26 * Allocate common data block and FPU data block in one
27 * chunk. This way we simplify things a lot.
29 * On native ports AROSCPUContext can be simply #define'd to ExceptionContext,
30 * so we refer struct AROSCPUContext only for size calculation.
32 ctx = krnAllocCPUContext();
33 if (ctx)
35 ctx->FPUType = KernelBase->kb_ContextFlags;
36 ctx->cpsr = CPUMODE_USER; /* Initial value for user mode */
37 #if AROS_BIG_ENDIAN
38 ctx->cpsr |= CPUMODE_BIGENDIAN;
39 #endif
40 ctx->fpuContext = (APTR)((IPTR)ctx + sizeof(struct AROSCPUContext));
43 return ctx;
45 AROS_LIBFUNC_EXIT