36 while (
tmp != NULL ) {
37 THRDBG(
"Examining cpu %#x at %p\n",
tmp->cpu_num,
tmp );
38 if (
tmp->cpu_num == cpu_num ) {
50 THRDBG(
"Found cpu %#x at %p\n", cpu_num,
tmp );
52 THRDBG(
"Did not find cpu %#x\n", cpu_num );
61 APIDBG(
"Entry: here: %p\n", here);
89 APIDBG(
"Entry: cpu_num: %d\n", cpu_num);
115 goto error_free_context;
123 goto error_free_contexts;
129 THRDBG(
"Allocated CpuInfo: %p\n", cpu );
147 APIDBG(
"Entry: entry: %p\n", entry);
151 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
158 ( entry !=
tmp ) || ( prev == NULL );
tmp =
tmp->next ) {
162 if (
tmp != entry ) {
163 THRDBG(
"Cpu %d at %p was not found in the cpu list!\n",
173 THRDBG(
"_papi_hwi_cpu_head now NULL\n" );
175 prev->next =
tmp->next;
179 THRDBG(
"_papi_hwi_cpu_head now cpu %d at %p\n",
182 THRDBG(
"Removed cpu %p from list\n",
tmp );
192 APIDBG(
"Entry: *cpu: %p, cpu_num: %d, cpu_users: %d\n",
193 *cpu, ( *cpu )->
cpu_num, (*cpu)->num_users);
201 users=(*cpu)->num_users;
209 if (users!=0)
return;
211 THRDBG(
"Shutting down cpu %d at %p\n", (*cpu)->cpu_num, cpu );
214 if (
_papi_hwd[
i]->cmp_info.disabled)
continue;
222 if ( ( *cpu )->context[
i] ) {
227 if ( ( *cpu )->context ) {
231 if ( ( *cpu )->running_eventset ) {
236 memset( *cpu, 0x00,
sizeof (
CpuInfo_t ) );
245 APIDBG(
"Entry: entry: %p\n", entry);
249 THRDBG(
"_papi_hwi_cpu_head is NULL\n" );
253 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
259 THRDBG(
"_papi_hwi_cpu_head was cpu %d at %p\n",
267 THRDBG(
"_papi_hwi_cpu_head now cpu %d at %p\n",
277 APIDBG(
"Entry: dest: %p, *dest: %p, cpu_num: %d\n", dest, *dest, cpu_num);
struct papi_vectors * _papi_hwd[]
static int remove_cpu(CpuInfo_t *entry)
int _papi_hwi_initialize_cpu(CpuInfo_t **dest, unsigned int cpu_num)
static CpuInfo_t * allocate_cpu(unsigned int cpu_num)
int _papi_hwi_lookup_or_create_cpu(CpuInfo_t **here, unsigned int cpu_num)
static CpuInfo_t * _papi_hwi_cpu_head
static CpuInfo_t * _papi_hwi_lookup_cpu(unsigned int cpu_num)
static void insert_cpu(CpuInfo_t *entry)
int _papi_hwi_shutdown_cpu(CpuInfo_t *cpu)
static void free_cpu(CpuInfo_t **cpu)
Return codes and api definitions.
#define THRDBG(format, args...)
#define APIDBG(format, args...)
#define papi_calloc(a, b)
EventSetInfo_t ** running_eventset
inline_static int _papi_hwi_lock(int lck)
inline_static int _papi_hwi_unlock(int lck)