1 #include <aros/kernel.h>
2 #include <aros/libcall.h>
4 #include <kernel_base.h>
5 #include <kernel_objects.h>
7 AROS_LH0I(void *, KrnCreateContext
,
8 struct KernelBase
*, KernelBase
, 18, Kernel
)
12 struct ExceptionContext
*ctx
;
14 /* Allocate a new context */
15 ctx
= krnAllocCPUContext();
17 /* Initialize the context */
23 * Sys V PPC ABI says r2 is reserved for TOC or SDATA2.
24 * Here we copy the current value and it will never be
25 * changed again. It is not needed for AROS but can be
26 * needed for host OS. It is known to be needed for Linux
27 * and won't harm anywhere else.
29 __asm__
__volatile__ ("stw 2,%0":"=m"(ctx
->gpr
[2])::"memory");
31 /* Initialize FPU portion */
33 for (i
= 0; i
< 32; i
++)