Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / common / include / asm.c
blob95e736ccfda34a95d26bb93df88cce9c4fe81198
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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>
12 #include <stddef.h>
14 #define DEFINE(sym, val) \
15 asm volatile("\n#define " #sym " %0 ": : "i" (val))
17 #define FuncOffset(x) (int)__AROS_GETJUMPVEC(0,x)
19 int main(void) {
20 asm volatile("\n/* Macros */" ::);
22 asm volatile("\n#define AROS_CSYMNAME(n) n\n" ::);
23 asm volatile("\n#define AROS_CDEFNAME(n) n\n" ::);
24 asm volatile("\n#define AROS_SLIB_ENTRY(n,s) s ## _ ## n\n" ::);
26 asm volatile("\n#define _FUNCTION(n) .type n,@function" ::);
27 asm volatile("\n#define _ALIGNMENT .balign %0" :: "i" (AROS_WORSTALIGN));
29 asm volatile("\n/* ExecBase */" ::);
30 DEFINE(AttnResched , offsetof (struct ExecBase, AttnResched));
31 DEFINE(IDNestCnt , offsetof (struct ExecBase, IDNestCnt));
32 DEFINE(TDNestCnt , offsetof (struct ExecBase, TDNestCnt));
33 DEFINE(TaskReady , offsetof (struct ExecBase, TaskReady));
34 DEFINE(ThisTask , offsetof (struct ExecBase, ThisTask));
35 DEFINE(SysFlags , offsetof (struct ExecBase, SysFlags));
36 DEFINE(IdleCount , offsetof (struct ExecBase, IdleCount));
37 DEFINE(DispCount , offsetof (struct ExecBase, DispCount));
38 DEFINE(Quantum , offsetof (struct ExecBase, Quantum));
39 DEFINE(Elapsed , offsetof (struct ExecBase, Elapsed));
41 asm volatile("\n/* struct Task */" ::);
42 DEFINE(tc_State , offsetof (struct Task, tc_State));
43 DEFINE(tc_Flags , offsetof (struct Task, tc_Flags));
44 DEFINE(tc_ExceptCode , offsetof (struct Task, tc_ExceptCode));
45 DEFINE(tc_ExceptData , offsetof (struct Task, tc_ExceptData));
46 DEFINE(tc_SigExcept , offsetof (struct Task, tc_SigExcept));
47 DEFINE(tc_SigRecvd , offsetof (struct Task, tc_SigRecvd));
48 DEFINE(tc_Launch , offsetof (struct Task, tc_Launch));
49 DEFINE(tc_Switch , offsetof (struct Task, tc_Switch));
50 DEFINE(tc_SPReg , offsetof (struct Task, tc_SPReg));
51 DEFINE(tc_SPLower , offsetof (struct Task, tc_SPLower));
52 DEFINE(tc_SPUpper , offsetof (struct Task, tc_SPUpper));
53 DEFINE(tc_IDNestCnt , offsetof (struct Task, tc_IDNestCnt));
54 DEFINE(tc_ETask , offsetof (struct Task, tc_UnionETask.tc_ETask));
55 DEFINE(iet_Context , sizeof (struct ETask) + 4);
57 asm volatile("\n/* struct DosBase */" ::);
58 DEFINE(dl_SysBase , offsetof (struct DosLibrary, dl_SysBase));
60 asm volatile("\n/* struct StackSwapStruct */" ::);
61 DEFINE(stk_Lower , offsetof (struct StackSwapStruct, stk_Lower));
62 DEFINE(stk_Upper , offsetof (struct StackSwapStruct, stk_Upper));
63 DEFINE(stk_Pointer , offsetof (struct StackSwapStruct, stk_Pointer));
65 asm volatile("\n/* Task Flags */" ::);
66 DEFINE(TS_RUN , TS_RUN);
67 DEFINE(TS_READY , TS_READY);
68 DEFINE(TF_EXCEPT , TF_EXCEPT);
69 DEFINE(TF_SWITCH , TF_SWITCH);
70 DEFINE(TF_LAUNCH , TF_LAUNCH);
72 asm volatile("\n/* Exec functions */" ::);
73 DEFINE(Reschedule , FuncOffset (8));
74 DEFINE(Switch , FuncOffset (9));
75 DEFINE(Dispatch , FuncOffset (10));
76 DEFINE(Exception , FuncOffset (11));
77 DEFINE(Alert , FuncOffset (18));
78 DEFINE(Disable , FuncOffset (20));
79 DEFINE(Enable , FuncOffset (21));
80 DEFINE(Enqueue , FuncOffset (45));
81 DEFINE(FindTask , FuncOffset (49));
82 DEFINE(StackSwap , FuncOffset (122));
84 asm volatile("\n/* Constants */" ::);
85 DEFINE(AT_DeadEnd , AT_DeadEnd);
86 DEFINE(AN_StackProbe , AN_StackProbe);
88 DEFINE(ln_Succ , offsetof (struct Node, ln_Succ));
89 DEFINE(ln_Pred , offsetof (struct Node, ln_Pred));
90 DEFINE(ln_Pri , offsetof (struct Node, ln_Pri));
92 DEFINE(lh_Head , offsetof (struct List, lh_Head));
93 DEFINE(lh_TailPred , offsetof (struct List, lh_TailPred));
96 #ifdef UseExecstubs
97 asm volatile("\n#define UseExecstubs 1" ::);
98 #endif
100 return 0;