blob: e14233f3e3ae8fef8596532836d29087a2cd2f27 (
plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
/* PR 3967
local-alloc screwed up consideration of high+lo_sum and created
reg_equivs that it shouldn't have, resulting in lo_sum with
uninitialized data, resulting in segv. The test has to remain
relatively large, since register spilling is required to twig
the bug. */
unsigned long *Local1;
unsigned long *Local2;
unsigned long *Local3;
unsigned long *RDbf1;
unsigned long *RDbf2;
unsigned long *RDbf3;
unsigned long *IntVc1;
unsigned long *IntVc2;
unsigned long *IntCode3;
unsigned long *IntCode4;
unsigned long *IntCode5;
unsigned long *IntCode6;
unsigned long *Lom1;
unsigned long *Lom2;
unsigned long *Lom3;
unsigned long *Lom4;
unsigned long *Lom5;
unsigned long *Lom6;
unsigned long *Lom7;
unsigned long *Lom8;
unsigned long *Lom9;
unsigned long *Lom10;
unsigned long *RDbf11;
unsigned long *RDbf12;
typedef struct
{
long a1;
unsigned long n1;
unsigned long local1;
unsigned long local2;
unsigned long local3;
unsigned long rdbf1;
unsigned long rdbf2;
unsigned long milli;
unsigned long frames1;
unsigned long frames2;
unsigned long nonShared;
long newPrivate;
long freeLimit;
unsigned long cache1;
unsigned long cache2;
unsigned long cache3;
unsigned long cache4;
unsigned long cache5;
unsigned long time6;
unsigned long frames7;
unsigned long page8;
unsigned long ot9;
unsigned long data10;
unsigned long bm11;
unsigned long misc12;
}
ShrPcCommonStatSType;
typedef struct
{
unsigned long sharedAttached;
unsigned long totalAttached;
long avgPercentShared;
unsigned long numberOfFreeFrames;
unsigned long localDirtyPageCount;
unsigned long globalDirtyPageCount;
long wakeupInterval;
unsigned long numActiveProcesses;
unsigned long numRecentActiveProcesses;
unsigned long gemDirtyPageKinds[10];
unsigned long stoneDirtyPageKinds[10];
unsigned long gemsInCacheCount;
long targetFreeFrameCount;
}
ShrPcMonStatSType;
typedef struct
{
unsigned long c1;
unsigned long c2;
unsigned long c3;
unsigned long c4;
unsigned long c5;
unsigned long c6;
unsigned long c7;
unsigned long c8;
unsigned long c9;
unsigned long c10;
unsigned long c11;
unsigned long c12;
unsigned long a1;
unsigned long a2;
unsigned long a3;
unsigned long a4;
unsigned long a5;
unsigned long a6;
unsigned long a7;
unsigned long a8;
unsigned long a9;
unsigned long a10;
unsigned long a11;
unsigned long a12;
unsigned long a13;
unsigned long a14;
unsigned long a15;
unsigned long a16;
unsigned long a17;
unsigned long a18;
unsigned long a19;
unsigned long sessionStats[40];
}
ShrPcGemStatSType;
union ShrPcStatUnion
{
ShrPcMonStatSType monitor;
ShrPcGemStatSType gem;
};
typedef struct
{
int processId;
int sessionId;
ShrPcCommonStatSType cmn;
union ShrPcStatUnion u;
} ShrPcStatsSType;
typedef struct
{
unsigned long *p1;
unsigned long *p2;
unsigned long *p3;
unsigned long *p4;
unsigned long *p5;
unsigned long *p6;
unsigned long *p7;
unsigned long *p8;
unsigned long *p9;
unsigned long *p10;
unsigned long *p11;
}
WorkEntrySType;
WorkEntrySType Workspace;
static void
setStatPointers (ShrPcStatsSType * statsPtr, long sessionId)
{
statsPtr->sessionId = sessionId;
statsPtr->cmn.a1 = 0;
statsPtr->cmn.n1 = 5;
Local1 = &statsPtr->cmn.local1;
Local2 = &statsPtr->cmn.local2;
Local3 = &statsPtr->cmn.local3;
RDbf1 = &statsPtr->cmn.rdbf1;
RDbf2 = &statsPtr->cmn.rdbf2;
RDbf3 = &statsPtr->cmn.milli;
*RDbf3 = 1;
IntVc1 = &statsPtr->u.gem.a1;
IntVc2 = &statsPtr->u.gem.a2;
IntCode3 = &statsPtr->u.gem.a3;
IntCode4 = &statsPtr->u.gem.a4;
IntCode5 = &statsPtr->u.gem.a5;
IntCode6 = &statsPtr->u.gem.a6;
{
WorkEntrySType *workSpPtr;
workSpPtr = &Workspace;
workSpPtr->p1 = &statsPtr->u.gem.a7;
workSpPtr->p2 = &statsPtr->u.gem.a8;
workSpPtr->p3 = &statsPtr->u.gem.a9;
workSpPtr->p4 = &statsPtr->u.gem.a10;
workSpPtr->p5 = &statsPtr->u.gem.a11;
workSpPtr->p6 = &statsPtr->u.gem.a12;
workSpPtr->p7 = &statsPtr->u.gem.a13;
workSpPtr->p8 = &statsPtr->u.gem.a14;
workSpPtr->p9 = &statsPtr->u.gem.a15;
workSpPtr->p10 = &statsPtr->u.gem.a16;
workSpPtr->p11 = &statsPtr->u.gem.a17;
}
Lom1 = &statsPtr->u.gem.c1;
Lom2 = &statsPtr->u.gem.c2;
Lom3 = &statsPtr->u.gem.c3;
Lom4 = &statsPtr->u.gem.c4;
Lom5 = &statsPtr->u.gem.c5;
Lom6 = &statsPtr->u.gem.c6;
Lom7 = &statsPtr->u.gem.c7;
Lom8 = &statsPtr->u.gem.c8;
Lom9 = &statsPtr->u.gem.c9;
Lom10 = &statsPtr->u.gem.c10;
RDbf11 = &statsPtr->u.gem.c11;
RDbf12 = &statsPtr->u.gem.c12;
}
typedef struct
{
ShrPcStatsSType stats;
} ShrPcPteSType;
ShrPcPteSType MyPte;
static void
initPte (void *shrpcPtr, long sessionId)
{
ShrPcPteSType *ptePtr;
ptePtr = &MyPte;
setStatPointers (&ptePtr->stats, sessionId);
}
void
InitCache (int sessionId)
{
initPte (0, sessionId);
}
int
main (int argc, char *argv[])
{
InitCache (5);
return 0;
}
|