2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/kernel.h>
7 #include <aros/libcall.h>
9 #include <kernel_base.h>
10 #include <kernel_objects.h>
12 AROS_LH0I(void *, KrnCreateContext
,
13 struct KernelBase
*, KernelBase
, 18, Kernel
)
17 struct ExceptionContext
*ctx
;
19 /* Allocate a new context */
20 ctx
= krnAllocCPUContext();
22 /* Initialize the context */
28 * Sys V PPC ABI says r2 is reserved for TOC or SDATA2.
29 * Here we copy the current value and it will never be
30 * changed again. It is not needed for AROS but can be
31 * needed for host OS. It is known to be needed for Linux
32 * and won't harm anywhere else.
34 __asm__
__volatile__ ("stw 2,%0":"=m"(ctx
->gpr
[2])::"memory");
36 /* Initialize FPU portion */
38 for (i
= 0; i
< 32; i
++)