compiler/clib: Do not call __arosc_get_ctype() for each call to a ctype.h macro.
[AROS.git] / arch / all-mingw32 / exec / platform_init.c
blob38a2a6a6b9d5aa6d9ef7abf26a66f70ccaac2c94
1 #include <aros/kernel.h>
2 #include <proto/arossupport.h>
3 #include <proto/exec.h>
5 #include "../kernel/hostinterface.h"
6 #include "exec_intern.h"
8 /*
9 * Note that we are called very early, so no exec calls here! We don't have
10 * ExecBase's functions table yet, only empty data structure!
11 * In fact this routine exists only because of need to link up FlushInstructionCache()
12 * function before creating vector table. This is done for convenience, what if at some
13 * point we are using complete jumps as vectors ? All other functions could be linked
14 * in normal init routine. But, well, we do it all in one place.
16 BOOL Exec_PreparePlatform(struct Exec_PlatformData *pd, struct TagItem *msg)
18 struct TagItem *tag;
19 struct HostInterface *HostIFace;
20 void *KernelLib;
21 APTR __stdcall (*GetCurrentProcess)(void);
23 tag = LibFindTagItem(KRN_HostInterface, msg);
24 if (!tag)
25 return FALSE;
27 HostIFace = (struct HostInterface *)tag->ti_Data;
29 KernelLib = HostIFace->hostlib_Open("kernel32.dll", NULL);
30 if (!KernelLib)
31 return FALSE;
33 pd->ExitProcess = HostIFace->hostlib_GetPointer(KernelLib, "ExitProcess", NULL);
34 if (!pd->ExitProcess)
35 return FALSE;
37 pd->FlushInstructionCache = HostIFace->hostlib_GetPointer(KernelLib, "FlushInstructionCache", NULL);
38 if (!pd->FlushInstructionCache)
39 return FALSE;
41 GetCurrentProcess = HostIFace->hostlib_GetPointer(KernelLib, "GetCurrentProcess", NULL);
42 if (!GetCurrentProcess)
43 return FALSE;
45 pd->Reboot = HostIFace->Reboot;
46 pd->MyProcess = GetCurrentProcess();
48 return TRUE;