2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/kernel.h>
7 #include <proto/arossupport.h>
8 #include <proto/exec.h>
10 #include "../kernel/hostinterface.h"
11 #include "exec_intern.h"
14 * Note that we are called very early, so no exec calls here! We don't have
15 * ExecBase's functions table yet, only empty data structure!
16 * In fact this routine exists only because of need to link up FlushInstructionCache()
17 * function before creating vector table. This is done for convenience, what if at some
18 * point we are using complete jumps as vectors ? All other functions could be linked
19 * in normal init routine. But, well, we do it all in one place.
21 BOOL
Exec_PreparePlatform(struct Exec_PlatformData
*pd
, struct TagItem
*msg
)
24 struct HostInterface
*HostIFace
;
26 APTR
__stdcall (*GetCurrentProcess
)(void);
28 tag
= LibFindTagItem(KRN_HostInterface
, msg
);
32 HostIFace
= (struct HostInterface
*)tag
->ti_Data
;
34 KernelLib
= HostIFace
->hostlib_Open("kernel32.dll", NULL
);
38 pd
->ExitProcess
= HostIFace
->hostlib_GetPointer(KernelLib
, "ExitProcess", NULL
);
42 pd
->FlushInstructionCache
= HostIFace
->hostlib_GetPointer(KernelLib
, "FlushInstructionCache", NULL
);
43 if (!pd
->FlushInstructionCache
)
46 GetCurrentProcess
= HostIFace
->hostlib_GetPointer(KernelLib
, "GetCurrentProcess", NULL
);
47 if (!GetCurrentProcess
)
50 pd
->Reboot
= HostIFace
->Reboot
;
51 pd
->MyProcess
= GetCurrentProcess();