2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id: geninc.c 20605 2004-01-15 07:28:18Z iaint $
6 #include <exec/alerts.h>
7 #include <exec/types.h>
8 #include <exec/execbase.h>
9 #include <exec/tasks.h>
10 #include <dos/dosextens.h>
14 #define FuncOffset(x) (int)__AROS_GETJUMPVEC(0,x)
18 printf ("/* Macros */\n"
19 #if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)
20 "#define AROS_CSYMNAME(n) _ ## n\n"
21 "#define AROS_CDEFNAME(n) _ ## n\n"
22 "#define AROS_SLIB_ENTRY(n,s) _ ## s ## _ ## n\n"
24 "#define AROS_CSYMNAME(n) n\n"
25 "#define AROS_CDEFNAME(n) n\n"
26 "#define AROS_SLIB_ENTRY(n,s) s ## _ ## n\n"
29 "#define _FUNCTION(n) .type n,@function\n"
30 "#define _ALIGNMENT .balign 16\n"
33 "#define _FUNCTION(n) .def n; .scl 2; .type 32; .endef\n"
34 "#define _ALIGNMENT .align 8\n"
38 printf ("/* ExecBase */\n");
39 printf ("#define AttnResched %d\n", offsetof (struct ExecBase
, AttnResched
));
40 printf ("#define IDNestCnt %d\n", offsetof (struct ExecBase
, IDNestCnt
));
41 printf ("#define TDNestCnt %d\n", offsetof (struct ExecBase
, TDNestCnt
));
42 printf ("#define TaskReady %d\n", offsetof (struct ExecBase
, TaskReady
));
43 printf ("#define ThisTask %d\n", offsetof (struct ExecBase
, ThisTask
));
45 printf ("\n/* struct Task */\n");
46 printf ("#define tc_State %d\n", offsetof (struct Task
, tc_State
));
47 printf ("#define tc_Flags %d\n", offsetof (struct Task
, tc_Flags
));
48 printf ("#define tc_ExceptCode %d\n", offsetof (struct Task
, tc_ExceptCode
));
49 printf ("#define tc_ExceptData %d\n", offsetof (struct Task
, tc_ExceptData
));
50 printf ("#define tc_SigExcept %d\n", offsetof (struct Task
, tc_SigExcept
));
51 printf ("#define tc_SigRecvd %d\n", offsetof (struct Task
, tc_SigRecvd
));
52 printf ("#define tc_Launch %d\n", offsetof (struct Task
, tc_Launch
));
53 printf ("#define tc_Switch %d\n", offsetof (struct Task
, tc_Switch
));
54 printf ("#define tc_SPReg %d\n", offsetof (struct Task
, tc_SPReg
));
55 printf ("#define tc_SPLower %d\n", offsetof (struct Task
, tc_SPLower
));
56 printf ("#define tc_SPUpper %d\n", offsetof (struct Task
, tc_SPUpper
));
57 printf ("#define tc_IDNestCnt %d\n", offsetof (struct Task
, tc_IDNestCnt
));
59 printf ("\n/* struct StackSwapStruct */\n");
60 printf ("#define stk_Lower %d\n", offsetof (struct StackSwapStruct
, stk_Lower
));
61 printf ("#define stk_Upper %d\n", offsetof (struct StackSwapStruct
, stk_Upper
));
62 printf ("#define stk_Pointer %d\n", offsetof (struct StackSwapStruct
, stk_Pointer
));
64 printf ("\n/* Task Flags */\n");
65 printf ("#define TS_RUN %d\n", TS_RUN
);
66 printf ("#define TS_READY %d\n", TS_READY
);
67 printf ("#define TF_EXCEPT 0x%04lX\n", TF_EXCEPT
);
68 printf ("#define TF_SWITCH 0x%04lX\n", TF_SWITCH
);
70 printf ("\n/* Exec functions */\n");
71 printf ("#define Switch %d\n", FuncOffset (9));
72 printf ("#define Dispatch %d\n", FuncOffset (10));
73 printf ("#define Exception %d\n", FuncOffset (11));
74 printf ("#define Alert %d\n", FuncOffset (18));
75 printf ("#define Disable %d\n", FuncOffset (20));
76 printf ("#define Enable %d\n", FuncOffset (21));
77 printf ("#define Enqueue %d\n", FuncOffset (45));
78 printf ("#define FindTask %d\n", FuncOffset (49));
79 printf ("#define StackSwap %d\n", FuncOffset (122));
81 printf ("\n/* Constants */\n");
82 printf ("#define AT_DeadEnd 0x%08X\n", AT_DeadEnd
);
83 printf ("#define AN_StackProbe 0x%08X\n", AN_StackProbe
);
86 printf ("#define UseExecstubs 1\n");