Wanderer/Info: fix compilation
[AROS.git] / arch / .unmaintained / m68k-linux / geninc.c
blobf56a6d421aedb07a43a4099d0f7e0978f91826ab
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: assembler include file generator
6 Lang: english
7 */
9 #include <sys/types.h>
10 #include <stdio.h>
11 #include <stddef.h>
12 #include <exec/alerts.h>
13 #include <exec/types.h>
14 #include <exec/execbase.h>
15 #include <exec/tasks.h>
16 #include <dos/dosextens.h>
17 #include <sigcore.h>
18 #include "machine.h"
19 #include "etask.h"
21 #define FuncOffset(x) (int)__AROS_GETJUMPVEC(0,x)
23 int main (void)
25 printf ("/* Macros */\n"
26 "#define AROS_CSYMNAME(n) n\n"
27 "#define AROS_CDEFNAME(n) n\n"
28 "#define AROS_SLIB_ENTRY(n,s) s ## _ ## n\n"
29 "\n");
31 printf ("/* ExecBase */\n");
32 printf ("#define AttnResched %d\n", offsetof (struct ExecBase, AttnResched));
33 printf ("#define IDNestCnt %d\n", offsetof (struct ExecBase, IDNestCnt));
34 printf ("#define TDNestCnt %d\n", offsetof (struct ExecBase, TDNestCnt));
35 printf ("#define TaskReady %d\n", offsetof (struct ExecBase, TaskReady));
36 printf ("#define ThisTask %d\n", offsetof (struct ExecBase, ThisTask));
37 printf ("#define SysFlags %d\n", offsetof (struct ExecBase, SysFlags));
39 printf ("\n/* struct Task */\n");
40 printf ("#define tc_State %d\n", offsetof (struct Task, tc_State));
41 printf ("#define tc_Flags %d\n", offsetof (struct Task, tc_Flags));
42 printf ("#define tc_ExceptCode %d\n", offsetof (struct Task, tc_ExceptCode));
43 printf ("#define tc_ExceptData %d\n", offsetof (struct Task, tc_ExceptData));
44 printf ("#define tc_SigExcept %d\n", offsetof (struct Task, tc_SigExcept));
45 printf ("#define tc_SigRecvd %d\n", offsetof (struct Task, tc_SigRecvd));
46 printf ("#define tc_Launch %d\n", offsetof (struct Task, tc_Launch));
47 printf ("#define tc_Switch %d\n", offsetof (struct Task, tc_Switch));
48 printf ("#define tc_SPReg %d\n", offsetof (struct Task, tc_SPReg));
49 printf ("#define tc_SPLower %d\n", offsetof (struct Task, tc_SPLower));
50 printf ("#define tc_SPUpper %d\n", offsetof (struct Task, tc_SPUpper));
51 printf ("#define tc_IDNestCnt %d\n", offsetof (struct Task, tc_IDNestCnt));
52 printf ("#define tc_UnionETask %d\n", offsetof (struct Task, tc_UnionETask));
54 printf ("\n/* struct DosBase */\n");
55 printf ("#define dl_SysBase %d\n", offsetof (struct DosLibrary, dl_SysBase));
57 printf ("\n/* struct StackSwapStruct */\n");
58 printf ("#define stk_Lower %d\n", offsetof (struct StackSwapStruct, stk_Lower));
59 printf ("#define stk_Upper %d\n", offsetof (struct StackSwapStruct, stk_Upper));
60 printf ("#define stk_Pointer %d\n", offsetof (struct StackSwapStruct, stk_Pointer));
62 printf ("\n/* struct sigcontext_struct */\n");
63 printf ("#define sc_mask %d\n", offsetof (struct sigcontext_struct, sc_mask));
64 printf ("#define sc_usp %d\n", offsetof (struct sigcontext_struct, sc_usp));
65 printf ("#define sc_d0 %d\n", offsetof (struct sigcontext_struct, sc_d0));
66 printf ("#define sc_d1 %d\n", offsetof (struct sigcontext_struct, sc_d1));
67 printf ("#define sc_a0 %d\n", offsetof (struct sigcontext_struct, sc_a0));
68 printf ("#define sc_a1 %d\n", offsetof (struct sigcontext_struct, sc_a1));
69 printf ("#define sc_pc %d\n", offsetof (struct sigcontext_struct, sc_pc));
70 printf ("#define sc_size %d\n", sizeof (struct sigcontext_struct));
72 printf ("\n/* struct AROS_cpu_context */\n");
73 printf ("#define regs %d\n", offsetof (struct AROS_cpu_context, regs));
74 printf ("#define fpregs %d\n", offsetof (struct AROS_cpu_context, fpregs));
76 printf ("\n/* struct IntETask */\n");
77 printf ("#define iet_Context %d\n", offsetof (struct IntETask, iet_Context));
79 printf ("\n/* Task Flags */\n");
80 printf ("#define TS_RUN %d\n", TS_RUN);
81 printf ("#define TS_READY %d\n", TS_READY);
82 printf ("#define TS_REMOVED %d\n", TS_REMOVED);
83 printf ("#define TF_EXCEPT 0x%04lX\n", TF_EXCEPT);
84 printf ("#define TF_SWITCH 0x%04lX\n", TF_SWITCH);
86 printf ("#define TB_EXCEPT %d\n", TB_EXCEPT);
87 printf ("#define TB_SWITCH %d\n", TB_SWITCH);
88 printf ("#define TB_LAUNCH %d\n", TB_LAUNCH);
90 printf ("\n/* Exec functions */\n");
91 printf ("#define Switch %d\n", FuncOffset (9));
92 printf ("#define Dispatch %d\n", FuncOffset (10));
93 printf ("#define Exception %d\n", FuncOffset (11));
94 printf ("#define Alert %d\n", FuncOffset (18));
95 printf ("#define Disable %d\n", FuncOffset (20));
96 printf ("#define Enable %d\n", FuncOffset (21));
97 printf ("#define Enqueue %d\n", FuncOffset (45));
98 printf ("#define CopyMem %d\n", FuncOffset (104));
99 printf ("#define StackSwap %d\n", FuncOffset (122));
101 printf ("\n/* Constants */\n");
102 printf ("#define AT_DeadEnd 0x%08X\n", AT_DeadEnd);
103 printf ("#define AN_StackProbe 0x%08X\n", AN_StackProbe);
105 #ifdef UseExecstubs
106 printf ("#define UseExecstubs 1\n");
107 #endif
108 #if UseRegisterArgs
109 printf ("#define UseRegisterArgs 1\n");
110 #endif
111 return 0;