- - Rewritten startup code. GDT, IDT and TSS moved away from zero page.
[AROS.git] / test / callhooktest.c
blob45edb64a4f5b6fee4289650b058ef0f138155a41
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CallHook arguments passing test.
6 */
8 #include <stdio.h>
9 #include <proto/alib.h>
10 #include <proto/aros.h>
11 #include <utility/hooks.h>
13 struct Params
15 STACKED char p1; STACKED short p2; STACKED int p3; STACKED long p4;
16 STACKED char p5; STACKED short p6; STACKED int p7; STACKED long p8;
17 STACKED char p9; STACKED short p10; STACKED int p11; STACKED long p12;
18 STACKED char p13; STACKED short p14; STACKED int p15; STACKED long p16;
21 AROS_UFH3(long, TestHook,
22 AROS_UFHA(struct Hook *, hook, A0),
23 AROS_UFHA(APTR, object, A2),
24 AROS_UFHA(struct Params *, params, A1))
26 AROS_USERFUNC_INIT
27 printf("TestHook(%p, %p, %d, %d, %d, %ld, %d, %d, %d, %ld, %d, %d, %d, %ld, %d, %d, %d, %ld)\n", hook, object,
28 params->p1, params->p2, params->p3, params->p4, params->p5, params->p6, params->p7, params->p8,
29 params->p9, params->p10, params->p11, params->p12, params->p13, params->p14, params->p15, params->p16);
30 return 0xbabadada;
31 AROS_USERFUNC_EXIT
34 int main (int argc, char ** argv)
36 struct Hook hook;
37 hook.h_Entry = (HOOKFUNC)TestHook;
38 long res = CallHook(&hook, 0x0,
39 (char) 0x1, (short) -0x1, (int) 0x2, (long) -0x2,
40 (char) 0x3, (short) -0x3, (int) 0x4, (long) -0x4,
41 (char) 0x5, (short) -0x5, (int) 0x6, (long) -0x6,
42 (char) 0x7, (short) -0x7, (int) 0x8, (long) -0x8
44 printf("CallHook result: %lx\n", res);
46 return (res == 0xbabadada) ? 0 : 1;