Copyright clean-up (part 1):
[AROS.git] / arch / i386-all / exec / cpu_init.c
blobc70147a352ff72eaa920ff66eb0441794d37cc43
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
7 #include <aros/symbolsets.h>
8 #include <proto/exec.h>
10 extern void AROS_SLIB_ENTRY(CopyMem_SSE, Exec, 104)();
11 extern void AROS_SLIB_ENTRY(CopyMemQuick_SSE, Exec, 105)();
13 static int cpu_Init(struct ExecBase *SysBase)
16 * Here we want to check what features are supported by our CPU.
17 * The idea is simple: we check flags of own CPU context. If kernel.resource
18 * detects SSE, it allocates additional storage for SSE contexts and sets ECF_FPX
19 * flag in the context structure.
20 * We do this because of two reasons:
21 * 1. processor.resource is not up yet.
22 * 2. We are exec, and we know what to do with our own internal structures. ;-)
23 * Normal applications should use processor.resource instead.
25 struct Task *me = FindTask(NULL);
26 struct ExceptionContext *ctx = me->tc_UnionETask.tc_ETask->et_RegFrame;
28 if (ctx->Flags & ECF_FPX)
30 D(bug("[exec] SSE detected\n"));
32 /* Use SSE version of CopyMem() and CopyMemQuick() */
33 SetFunction(&SysBase->LibNode, -104*LIB_VECTSIZE, AROS_SLIB_ENTRY(CopyMem_SSE, Exec, 104));
34 SetFunction(&SysBase->LibNode, -105*LIB_VECTSIZE, AROS_SLIB_ENTRY(CopyMemQuick_SSE, Exec, 105));
37 return TRUE;
40 ADD2INITLIB(cpu_Init, 0);