root/opal/include/opal/sys/timer.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. opal_sys_timer_is_monotonic

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2014 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2016      Broadcom Limited. All rights reserved.
  14  * Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
  15  *                         reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 /** @file
  24  *
  25  * Cycle counter reading instructions.  Do not use directly - see the
  26  * timer interface instead
  27  */
  28 
  29 #ifndef OPAL_SYS_TIMER_H
  30 #define OPAL_SYS_TIMER_H 1
  31 
  32 #include "opal_config.h"
  33 
  34 #include "opal/sys/architecture.h"
  35 
  36 #ifdef HAVE_SYS_TYPES_H
  37 #include <sys/types.h>
  38 #endif
  39 
  40 /* do some quick #define cleanup in cases where we are doing
  41    testing... */
  42 #ifdef OPAL_DISABLE_INLINE_ASM
  43 #undef OPAL_C_GCC_INLINE_ASSEMBLY
  44 #define OPAL_C_GCC_INLINE_ASSEMBLY 0
  45 #endif
  46 
  47 /* define OPAL_{GCC,DEC,XLC}_INLINE_ASSEMBLY based on the
  48    OPAL_{C,CXX}_{GCC,DEC,XLC}_INLINE_ASSEMBLY defines and whether we
  49    are in C or C++ */
  50 #if defined(c_plusplus) || defined(__cplusplus)
  51 #define OPAL_GCC_INLINE_ASSEMBLY OPAL_CXX_GCC_INLINE_ASSEMBLY
  52 #else
  53 #define OPAL_GCC_INLINE_ASSEMBLY OPAL_C_GCC_INLINE_ASSEMBLY
  54 #endif
  55 
  56 /**********************************************************************
  57  *
  58  * Load the appropriate architecture files and set some reasonable
  59  * default values for our support
  60  *
  61  *********************************************************************/
  62 
  63 /* By default we suppose all timers are monotonic per node. */
  64 #define OPAL_TIMER_MONOTONIC 1
  65 
  66 BEGIN_C_DECLS
  67 
  68 /* If you update this list, you probably also want to update
  69    opal/mca/timer/linux/configure.m4.  Or not. */
  70 
  71 #if defined(DOXYGEN)
  72 /* don't include system-level gorp when generating doxygen files */
  73 #elif OPAL_ASSEMBLY_ARCH == OPAL_X86_64
  74 #include "opal/sys/x86_64/timer.h"
  75 #elif OPAL_ASSEMBLY_ARCH == OPAL_ARM
  76 #include "opal/sys/arm/timer.h"
  77 #elif OPAL_ASSEMBLY_ARCH == OPAL_ARM64
  78 #include "opal/sys/arm64/timer.h"
  79 #elif OPAL_ASSEMBLY_ARCH == OPAL_IA32
  80 #include "opal/sys/ia32/timer.h"
  81 #elif OPAL_ASSEMBLY_ARCH == OPAL_IA64
  82 #include "opal/sys/ia64/timer.h"
  83 #elif OPAL_ASSEMBLY_ARCH == OPAL_POWERPC32
  84 #include "opal/sys/powerpc/timer.h"
  85 #elif OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64
  86 #include "opal/sys/powerpc/timer.h"
  87 #elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_32
  88 #include "opal/sys/sparcv9/timer.h"
  89 #elif OPAL_ASSEMBLY_ARCH == OPAL_SPARCV9_64
  90 #include "opal/sys/sparcv9/timer.h"
  91 #elif OPAL_ASSEMBLY_ARCH == OPAL_MIPS
  92 #include "opal/sys/mips/timer.h"
  93 #endif
  94 
  95 #ifndef DOXYGEN
  96 #ifndef OPAL_HAVE_SYS_TIMER_GET_CYCLES
  97 #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
  98 
  99 typedef long opal_timer_t;
 100 #endif
 101 
 102 #ifndef OPAL_HAVE_SYS_TIMER_GET_FREQ
 103 #define OPAL_HAVE_SYS_TIMER_GET_FREQ 0
 104 #endif
 105 #endif
 106 
 107 #ifndef OPAL_HAVE_SYS_TIMER_IS_MONOTONIC
 108 
 109 #define OPAL_HAVE_SYS_TIMER_IS_MONOTONIC 1
 110 
 111 static inline bool opal_sys_timer_is_monotonic (void)
 112 {
 113     return OPAL_TIMER_MONOTONIC;
 114 }
 115 
 116 #endif
 117 
 118 END_C_DECLS
 119 
 120 #endif /* OPAL_SYS_TIMER_H */

/* [<][>][^][v][top][bottom][index][help] */