1 #include <aros/debug.h>
3 #include <aros/symbolsets.h>
4 #include <exec/lists.h>
6 #include <exec/resident.h>
7 #include <exec/memheaderext.h>
8 #include <utility/tagitem.h>
10 #include <proto/exec.h>
11 #include <proto/kernel.h>
12 #include <aros/kernel.h>
13 #include <proto/arossupport.h>
15 #include <clib/alib_protos.h>
17 #include "kernel_intern.h"
19 void prepare_host_hook(struct Hook
* hook
)
21 hook
->h_Entry
= HookEntry
;
25 AROS_LH1(struct TagItem
*, KrnGetHooks
,
28 AROS_LHA(UBYTE
*, name
, A1
),
31 struct KernelBase
*, KernelBase
, 2, Kernel
)
36 struct TagItem
* hooks
= 0;
42 struct TagItem
* msg
= KrnGetBootInfo();
43 hooks
= (struct TagItem
*)krnGetTagData(KRN_KernelHooks
, 0, msg
);
45 KRNWireImpl(LoadNativeLib
);
46 hooks
= CALLHOOKPKT(krnLoadNativeLibImpl
,name
,0);
49 for (i
= 0; hooks
[i
].ti_Tag
!= TAG_DONE
; ++i
)
51 struct Hook
* hook
= (struct Hook
*)hooks
[i
].ti_Data
;
52 prepare_host_hook(hook
);
60 AROS_LH1(struct TagItem
*, KrnRelaseHooks
,
63 AROS_LHA(struct TagItem
*, handle
, A1
),
66 struct KernelBase
*, KernelBase
, 2, Kernel
)
71 KRNWireImpl(UnloadNativeLib
);
72 CALLHOOKPKT(krnUnloadNativeLibImpl
,handle
,0);
80 AROS_LH2(void, KrnImportHookListToHost
,
83 AROS_LHA(struct TagItem
*, hooks
, A1
),
84 AROS_LHA(const char*, name
, A2
),
87 struct KernelBase
*, KernelBase
, 20, Kernel
)
91 struct TagItem
[2] tags
;
93 tags
[0].ti_tag
= KRN_HookList
;
94 tags
[0].ti_data
= (ULONG
)hooks
;
95 tags
[1].ti_tag
= KRN_HookListName
;
96 tags
[1].ti_data
= (ULONG
)name
;