File: solaris-ultra.h

package info (click to toggle)
papi 5.7.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (92 lines) | stat: -rw-r--r-- 1,957 bytes parent folder | download | duplicates (4)
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
#ifndef _PAPI_SOLARIS_ULTRA_H
#define _PAPI_SOLARIS_ULTRA_H

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include <libgen.h>
#include <limits.h>
#include <synch.h>
#include <procfs.h>
#include <libcpc.h>
#include <libgen.h>
#include <ctype.h>
#include <errno.h>
#include <sys/times.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/processor.h>
#include <sys/procset.h>
#include <syms.h>
#include <dlfcn.h>
#include <sys/stat.h>

#include "papi_defines.h"

#define MAX_COUNTERS 2
#define MAX_COUNTER_TERMS MAX_COUNTERS
#define PAPI_MAX_NATIVE_EVENTS 71
#define MAX_NATIVE_EVENT PAPI_MAX_NATIVE_EVENTS
#define MAX_NATIVE_EVENT_USII  22

/* Defines in papi_internal.h cause compile warnings on solaris because typedefs are done here */
#undef hwd_context_t
#undef hwd_control_state_t
#undef hwd_reg_alloc_t
#undef hwd_register_t
#undef hwd_siginfo_t
#undef hwd_ucontext_t

typedef int hwd_reg_alloc_t;

typedef struct US_register
{
	int event[MAX_COUNTERS];
} hwd_register_t;

typedef struct papi_cpc_event
{
	/* Structure to libcpc */
	cpc_event_t cmd;
	/* Flags to kernel */
	int flags;
} papi_cpc_event_t;

typedef struct hwd_control_state
{
	/* Buffer to pass to the kernel to control the counters */
	papi_cpc_event_t counter_cmd;
	/* overflow event counter */
	int overflow_num;
} hwd_control_state_t;

typedef int hwd_register_map_t;

typedef struct _native_info
{
	/* native name */
	char name[40];
	/* Buffer to pass to the kernel to control the counters */
	int encoding[MAX_COUNTERS];
} native_info_t;

#include "solaris-context.h"

typedef int hwd_context_t;

/* Assembler prototypes */

extern void cpu_sync( void );
extern unsigned long long get_tick( void );
extern caddr_t _start, _end, _etext, _edata;

extern rwlock_t lock[PAPI_MAX_LOCK];

#define _papi_hwd_lock(lck) rw_wrlock(&lock[lck]);

#define _papi_hwd_unlock(lck)   rw_unlock(&lock[lck]);

#endif