1
1

* more AIX timer changes. Rough implementation, and some configure

updates that should make things out on aries happier

This commit was SVN r6963.
Этот коммит содержится в:
Brian Barrett 2005-08-21 22:43:40 +00:00
родитель 2191d4a6b9
Коммит 0eb5337230
3 изменённых файлов: 64 добавлений и 14 удалений

Просмотреть файл

@ -43,14 +43,26 @@ AC_DEFUN([MCA_timer_aix_CONFIG],[
[timer_aix_happy="yes"],
[timer_aix_happy="no"])])
# look to see if -lpmapi is available
timer_aix_LIBS=
timer_aix_LIBS_SAVE="$LIBS"
AS_IF([test "$timer_aix_happy" = "yes"],
[AC_CHECK_FUNC([pm_cycles],
[timer_aix_happy="yes"],
[timer_aix_happy="no"])])
[AC_CHECK_LIB([pmapi],
[pm_cycles],
[timer_aix_LIBS="-lpmapi"],
[timer_aix_LIBS=""])])
AS_IF([test "$timer_aix_happy" = "no" -a \
"$timer_aix_should_use" = "1"],
[AC_MSG_ERROR([AIX timer requested but not available. Aborting.])])
# get us a HAVE_PM_CYCLES #define
AS_IF([test "$timer_aix_happy" = "yes"],
[AC_CHECK_FUNCS([pm_cycles])
AC_CHECK_HEADERS([pmapi.h])])
LIBS="$timer_aix_LIBS_SAVE"
AS_IF([test "$timer_aix_happy" = "no" -a \
"$timer_aix_should_use" = "1"],
[AC_MSG_ERROR([AIX timer requested but not available. Aborting.])])
AC_SUBST(timer_aix_LIBS)
AS_IF([test "$timer_aix_happy" = "yes"],
[timer_base_include="aix/timer_aix.h"

Просмотреть файл

@ -17,35 +17,51 @@
#ifndef OPAL_MCA_TIMER_AIX_TIMER_AIX_H
#define OPAL_MCA_TIMER_AIX_TIMER_AIX_H
#if 0
#include <sys/time.h>
#include <pmapi.h>
#endif
typedef uint64_t opal_timer_t;
extern opal_timer_t opal_timer_aix_freq_mhz;
extern opal_timer_t opal_timer_aix_freq;
static inline opal_timer_t
opal_timer_base_get_cycles()
{
#ifdef HAVE_PM_CYCLES
return opal_timer_base_get_usec * opal_timer_aix_freq_mhz;
#else
return 0;
#endif
}
static inline opal_timer_t
opal_timer_base_get_usec()
{
return 0;
timebasestruct_t t;
uint64_t retval;
read_real_time(&t, TIMEBASE_SZ);
time_base_to_time(&t, TIMEBASE_SZ);
retval = (t.tb_high * 1000000) + t.tb_low / 1000;
return retval;
}
static inline opal_timer_t
opal_timer_base_get_freq()
{
return 0;
return opal_timer_aix_freq;;
}
#ifdef HAVE_PM_CYCLES
#define OPAL_TIMER_CYCLE_NATIVE 0
#define OPAL_TIMER_CYCLE_SUPPORTED 1
#else
#define OPAL_TIMER_CYCLE_NATIVE 0
#define OPAL_TIMER_CYCLE_SUPPORTED 0
#define OPAL_TIMER_USEC_NATIVE 0
#define OPAL_TIMER_USEC_SUPPORTED 0
#endif
#define OPAL_TIMER_USEC_NATIVE 1
#define OPAL_TIMER_USEC_SUPPORTED 1
#endif

Просмотреть файл

@ -19,6 +19,15 @@
#include "opal/mca/timer/timer.h"
#include "opal/mca/timer/aix/timer_aix.h"
#include <sys/time.h>
#ifdef HAVE_PMAPI_H
#include <pmapi.h>
#endif
opal_timer_t opal_timer_aix_freq_mhz;
opal_timer_t opal_timer_aix_freq;
static int opal_timer_aix_open(void);
const opal_timer_base_component_1_0_0_t mca_timer_aix_component = {
/* First, the mca_component_t struct containing meta information
@ -35,7 +44,7 @@ const opal_timer_base_component_1_0_0_t mca_timer_aix_component = {
OPAL_RELEASE_VERSION,
/* Component open and close functions */
NULL,
opal_timer_aix_open,
NULL
},
@ -45,3 +54,16 @@ const opal_timer_base_component_1_0_0_t mca_timer_aix_component = {
true
},
};
static int
opal_timer_aix_open(void)
{
#ifdef HAVE_PM_CYCLES
opal_timer_aix_freq = pm_cycles();
opal_timer_aix_freq_mhz = opal_timer_aix_freq / 1000000;
#else
opal_timer_aix_freq_mhz = 0;
opal_timer_aix_freq = 0;
#endif
}