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"
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
)
19 struct HostInterface
*HostIFace
;
21 APTR
__stdcall (*GetCurrentProcess
)(void);
23 tag
= LibFindTagItem(KRN_HostInterface
, msg
);
27 HostIFace
= (struct HostInterface
*)tag
->ti_Data
;
29 KernelLib
= HostIFace
->hostlib_Open("kernel32.dll", NULL
);
33 pd
->ExitProcess
= HostIFace
->hostlib_GetPointer(KernelLib
, "ExitProcess", NULL
);
37 pd
->FlushInstructionCache
= HostIFace
->hostlib_GetPointer(KernelLib
, "FlushInstructionCache", NULL
);
38 if (!pd
->FlushInstructionCache
)
41 GetCurrentProcess
= HostIFace
->hostlib_GetPointer(KernelLib
, "GetCurrentProcess", NULL
);
42 if (!GetCurrentProcess
)
45 pd
->Reboot
= HostIFace
->Reboot
;
46 pd
->MyProcess
= GetCurrentProcess();