|
PAPI
5.0.1.0
|
00001 #ifndef _PAPI_SOLARIS_H 00002 #define _PAPI_SOLARIS_H 00003 00004 #include <synch.h> 00005 #include <procfs.h> 00006 #include <libcpc.h> 00007 #include <sys/procset.h> 00008 #include <syms.h> 00009 00010 int _solaris_update_shlib_info( papi_mdi_t *mdi ); 00011 int _solaris_get_system_info( papi_mdi_t *mdi ); 00012 long long _solaris_get_real_usec( void ); 00013 long long _solaris_get_real_cycles( void ); 00014 long long _solaris_get_virt_usec( void ); 00015 00016 /* Assembler prototypes */ 00017 00018 extern void cpu_sync( void ); 00019 extern caddr_t _start, _end, _etext, _edata; 00020 00021 extern rwlock_t lock[PAPI_MAX_LOCK]; 00022 00023 #define _papi_hwd_lock(lck) rw_wrlock(&lock[lck]); 00024 00025 #define _papi_hwd_unlock(lck) rw_unlock(&lock[lck]); 00026 00027 #endif 00028 00029 #if 0 00030 00031 #include <sys/asm_linkage.h> 00032 ! #include "solaris-ultra.h" 00033 00034 ! These functions blatantly stolen from perfmon 00035 ! The author of the package "perfmon" is Richard J. Enbody 00036 ! and the home page for "perfmon" is 00037 ! http://www.cps.msu.edu/~enbody/perfmon/index.html 00038 00039 ! 00040 ! extern void cpu_sync(void); 00041 ! 00042 ! Make sure all instructinos and memory references before us 00043 ! have been completed. 00044 .global cpu_sync 00045 ENTRY(cpu_sync) 00046 membar #Sync ! Wait for all outstanding things to finish 00047 retl ! Return to the caller 00048 nop ! Delay slot 00049 SET_SIZE(cpu_sync) 00050 00051 ! 00052 ! extern unsigned long long get_tick(void) 00053 ! 00054 ! Read the tick register and return it 00055 .global get_tick 00056 ENTRY(get_tick) 00057 rd %tick, %o0 ! Get the current value of TICK 00058 clruw %o0, %o1 ! put the lower 32 bits into %o1 00059 retl ! Return to the caller 00060 srlx %o0, 32, %o0 ! put the upper 32 bits into %o0 00061 SET_SIZE(get_tick) 00062 00063 #endif 00064 00065 00066 00067 00068