Go to the source code of this file.
◆ _papi_hwi_initialize_cpu()
Definition at line 275 of file cpus.c.
276{
277 APIDBG(
"Entry: dest: %p, *dest: %p, cpu_num: %d\n", dest, *dest, cpu_num);
278
282
284 *dest = NULL;
286 }
287
288
292 continue;
296 *dest = NULL;
298 }
299 }
300
302
303 *dest = cpu;
305}
struct papi_vectors * _papi_hwd[]
static CpuInfo_t * allocate_cpu(unsigned int cpu_num)
static void insert_cpu(CpuInfo_t *entry)
static void free_cpu(CpuInfo_t **cpu)
#define APIDBG(format, args...)
◆ _papi_hwi_lookup_cpu()
static CpuInfo_t * _papi_hwi_lookup_cpu |
( |
unsigned int |
cpu_num | ) |
|
|
static |
Definition at line 29 of file cpus.c.
30{
32
34
36 while (
tmp != NULL ) {
37 THRDBG(
"Examining cpu %#x at %p\n",
tmp->cpu_num,
tmp );
38 if (
tmp->cpu_num == cpu_num ) {
39 break;
40 }
44 break;
45 }
46 }
47
50 THRDBG(
"Found cpu %#x at %p\n", cpu_num,
tmp );
51 } else {
52 THRDBG(
"Did not find cpu %#x\n", cpu_num );
53 }
54
56}
static CpuInfo_t * _papi_hwi_cpu_head
#define THRDBG(format, args...)
◆ _papi_hwi_lookup_or_create_cpu()
int _papi_hwi_lookup_or_create_cpu |
( |
CpuInfo_t ** |
here, |
|
|
unsigned int |
cpu_num |
|
) |
| |
Definition at line 59 of file cpus.c.
60{
61 APIDBG(
"Entry: here: %p\n", here);
62
65
67
71 }
72
73
75
78 }
79
81
83}
int _papi_hwi_initialize_cpu(CpuInfo_t **dest, unsigned int cpu_num)
static CpuInfo_t * _papi_hwi_lookup_cpu(unsigned int cpu_num)
inline_static int _papi_hwi_lock(int lck)
inline_static int _papi_hwi_unlock(int lck)
◆ _papi_hwi_shutdown_cpu()
◆ allocate_cpu()
Definition at line 87 of file cpus.c.
88{
89 APIDBG(
"Entry: cpu_num: %d\n", cpu_num);
90
93
94
96 if ( cpu == NULL ) {
97 goto allocate_error;
98 }
99
100
106 goto error_free_cpu;
107 }
108
109
110
115 goto error_free_context;
116 }
117
123 goto error_free_contexts;
124 }
125 }
126
128
129 THRDBG(
"Allocated CpuInfo: %p\n", cpu );
130
131 return cpu;
132
133error_free_contexts:
135error_free_context:
137error_free_cpu:
139allocate_error:
140 return NULL;
141}
#define papi_calloc(a, b)
EventSetInfo_t ** running_eventset
◆ free_cpu()
Definition at line 190 of file cpus.c.
191{
192 APIDBG(
"Entry: *cpu: %p, cpu_num: %d, cpu_users: %d\n",
193 *cpu, ( *cpu )->cpu_num, (*cpu)->num_users);
194
196
198
199 (*cpu)->num_users--;
200
201 users=(*cpu)->num_users;
202
203
205
207
208
209 if (users!=0) return;
210
211 THRDBG(
"Shutting down cpu %d at %p\n", (*cpu)->cpu_num, cpu );
212
214 if (
_papi_hwd[
i]->cmp_info.disabled)
continue;
217
218 }
219 }
220
222 if ( ( *cpu )->context[
i] ) {
224 }
225 }
226
227 if ( ( *cpu )->context ) {
229 }
230
231 if ( ( *cpu )->running_eventset ) {
233 }
234
235
236 memset( *cpu, 0x00,
sizeof (
CpuInfo_t ) );
238 *cpu = NULL;
239}
static int remove_cpu(CpuInfo_t *entry)
◆ insert_cpu()
Definition at line 243 of file cpus.c.
244{
245 APIDBG(
"Entry: entry: %p\n", entry);
246
248
249 THRDBG(
"_papi_hwi_cpu_head is NULL\n" );
252
253 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
257 } else {
258
259 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
263 }
264
266
267 THRDBG(
"_papi_hwi_cpu_head now cpu %d at %p\n",
269}
◆ remove_cpu()
Definition at line 145 of file cpus.c.
146{
147 APIDBG(
"Entry: entry: %p\n", entry);
148
150
151 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
153
154
155
156
158 ( entry !=
tmp ) || ( prev == NULL );
tmp =
tmp->next ) {
160 }
161
162 if (
tmp != entry ) {
163 THRDBG(
"Cpu %d at %p was not found in the cpu list!\n",
166 }
167
168
169
173 THRDBG(
"_papi_hwi_cpu_head now NULL\n" );
174 } else {
175 prev->next =
tmp->next;
176
179 THRDBG(
"_papi_hwi_cpu_head now cpu %d at %p\n",
181 }
182 THRDBG(
"Removed cpu %p from list\n",
tmp );
183 }
184
186}
◆ _papi_hwi_cpu_head