makethreadasm.c
5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include <os.h>
OSThread t;
main(int argc, char **argv)
{
printf("#define T_NEXT %d\n",
(unsigned long)&t.next - (unsigned long)&t);
printf("#define T_PRIORITY %d\n",
(unsigned long)&t.priority - (unsigned long)&t);
printf("#define T_ID %d\n",
(unsigned long)&t.id - (unsigned long)&t);
printf("#define T_FP %d\n",
(unsigned long)&t.fp - (unsigned long)&t);
printf("#define T_THPROF %d\n",
(unsigned long)&t.thprof - (unsigned long)&t);
printf("#define T_CONTEXT_AT %d\n",
(unsigned long)&t.context.at - (unsigned long)&t);
printf("#define T_CONTEXT_V0 %d\n",
(unsigned long)&t.context.v0 - (unsigned long)&t);
printf("#define T_CONTEXT_V1 %d\n",
(unsigned long)&t.context.v1 - (unsigned long)&t);
printf("#define T_CONTEXT_A0 %d\n",
(unsigned long)&t.context.a0 - (unsigned long)&t);
printf("#define T_CONTEXT_A1 %d\n",
(unsigned long)&t.context.a1 - (unsigned long)&t);
printf("#define T_CONTEXT_A2 %d\n",
(unsigned long)&t.context.a2 - (unsigned long)&t);
printf("#define T_CONTEXT_A3 %d\n",
(unsigned long)&t.context.a3 - (unsigned long)&t);
printf("#define T_CONTEXT_T0 %d\n",
(unsigned long)&t.context.t0 - (unsigned long)&t);
printf("#define T_CONTEXT_T1 %d\n",
(unsigned long)&t.context.t1 - (unsigned long)&t);
printf("#define T_CONTEXT_T2 %d\n",
(unsigned long)&t.context.t2 - (unsigned long)&t);
printf("#define T_CONTEXT_T3 %d\n",
(unsigned long)&t.context.t3 - (unsigned long)&t);
printf("#define T_CONTEXT_T4 %d\n",
(unsigned long)&t.context.t4 - (unsigned long)&t);
printf("#define T_CONTEXT_T5 %d\n",
(unsigned long)&t.context.t5 - (unsigned long)&t);
printf("#define T_CONTEXT_T6 %d\n",
(unsigned long)&t.context.t6 - (unsigned long)&t);
printf("#define T_CONTEXT_T7 %d\n",
(unsigned long)&t.context.t7 - (unsigned long)&t);
printf("#define T_CONTEXT_S0 %d\n",
(unsigned long)&t.context.s0 - (unsigned long)&t);
printf("#define T_CONTEXT_S1 %d\n",
(unsigned long)&t.context.s1 - (unsigned long)&t);
printf("#define T_CONTEXT_S2 %d\n",
(unsigned long)&t.context.s2 - (unsigned long)&t);
printf("#define T_CONTEXT_S3 %d\n",
(unsigned long)&t.context.s3 - (unsigned long)&t);
printf("#define T_CONTEXT_S4 %d\n",
(unsigned long)&t.context.s4 - (unsigned long)&t);
printf("#define T_CONTEXT_S5 %d\n",
(unsigned long)&t.context.s5 - (unsigned long)&t);
printf("#define T_CONTEXT_S6 %d\n",
(unsigned long)&t.context.s6 - (unsigned long)&t);
printf("#define T_CONTEXT_S7 %d\n",
(unsigned long)&t.context.s7 - (unsigned long)&t);
printf("#define T_CONTEXT_T8 %d\n",
(unsigned long)&t.context.t8 - (unsigned long)&t);
printf("#define T_CONTEXT_T9 %d\n",
(unsigned long)&t.context.t9 - (unsigned long)&t);
printf("#define T_CONTEXT_GP %d\n",
(unsigned long)&t.context.gp - (unsigned long)&t);
printf("#define T_CONTEXT_SP %d\n",
(unsigned long)&t.context.sp - (unsigned long)&t);
printf("#define T_CONTEXT_S8 %d\n",
(unsigned long)&t.context.s8 - (unsigned long)&t);
printf("#define T_CONTEXT_RA %d\n",
(unsigned long)&t.context.ra - (unsigned long)&t);
printf("#define T_CONTEXT_LO %d\n",
(unsigned long)&t.context.lo - (unsigned long)&t);
printf("#define T_CONTEXT_HI %d\n",
(unsigned long)&t.context.hi - (unsigned long)&t);
printf("#define T_CONTEXT_SR %d\n",
(unsigned long)&t.context.sr - (unsigned long)&t);
printf("#define T_CONTEXT_PC %d\n",
(unsigned long)&t.context.pc - (unsigned long)&t);
printf("#define T_CONTEXT_CAUSE %d\n",
(unsigned long)&t.context.cause - (unsigned long)&t);
printf("#define T_CONTEXT_BADVADDR %d\n",
(unsigned long)&t.context.badvaddr - (unsigned long)&t);
printf("#define T_CONTEXT_RCP %d\n",
(unsigned long)&t.context.rcp - (unsigned long)&t);
printf("#define T_CONTEXT_FPCSR %d\n",
(unsigned long)&t.context.fpcsr - (unsigned long)&t);
printf("#define T_CONTEXT_FP0 %d\n",
(unsigned long)&t.context.fp0 - (unsigned long)&t);
printf("#define T_CONTEXT_FP2 %d\n",
(unsigned long)&t.context.fp2 - (unsigned long)&t);
printf("#define T_CONTEXT_FP4 %d\n",
(unsigned long)&t.context.fp4 - (unsigned long)&t);
printf("#define T_CONTEXT_FP6 %d\n",
(unsigned long)&t.context.fp6 - (unsigned long)&t);
printf("#define T_CONTEXT_FP8 %d\n",
(unsigned long)&t.context.fp8 - (unsigned long)&t);
printf("#define T_CONTEXT_FP10 %d\n",
(unsigned long)&t.context.fp10 - (unsigned long)&t);
printf("#define T_CONTEXT_FP12 %d\n",
(unsigned long)&t.context.fp12 - (unsigned long)&t);
printf("#define T_CONTEXT_FP14 %d\n",
(unsigned long)&t.context.fp14 - (unsigned long)&t);
printf("#define T_CONTEXT_FP16 %d\n",
(unsigned long)&t.context.fp16 - (unsigned long)&t);
printf("#define T_CONTEXT_FP18 %d\n",
(unsigned long)&t.context.fp18 - (unsigned long)&t);
printf("#define T_CONTEXT_FP20 %d\n",
(unsigned long)&t.context.fp20 - (unsigned long)&t);
printf("#define T_CONTEXT_FP22 %d\n",
(unsigned long)&t.context.fp22 - (unsigned long)&t);
printf("#define T_CONTEXT_FP24 %d\n",
(unsigned long)&t.context.fp24 - (unsigned long)&t);
printf("#define T_CONTEXT_FP26 %d\n",
(unsigned long)&t.context.fp26 - (unsigned long)&t);
printf("#define T_CONTEXT_FP28 %d\n",
(unsigned long)&t.context.fp28 - (unsigned long)&t);
printf("#define T_CONTEXT_FP30 %d\n",
(unsigned long)&t.context.fp30 - (unsigned long)&t);
printf("#define T_STATE %d\n",
(unsigned long)&t.state - (unsigned long)&t);
printf("#define T_FLAGS %d\n",
(unsigned long)&t.flags - (unsigned long)&t);
printf("#define T_TLNEXT %d\n",
(unsigned long)&t.tlnext - (unsigned long)&t);
printf("#define T_QUEUE %d\n",
(unsigned long)&t.queue - (unsigned long)&t);
return 0;
}