root/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/timer.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. pmix_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 (c) 2018      Intel, Inc.  All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 /** @file
  25  *
  26  * Cycle counter reading instructions.  Do not use directly - see the
  27  * timer interface instead
  28  */
  29 
  30 #ifndef PMIX_SYS_TIMER_H
  31 #define PMIX_SYS_TIMER_H 1
  32 
  33 #include "pmix_config.h"
  34 
  35 #include "src/atomics/sys/architecture.h"
  36 
  37 #ifdef HAVE_SYS_TYPES_H
  38 #include <sys/types.h>
  39 #endif
  40 
  41 /* do some quick #define cleanup in cases where we are doing
  42    testing... */
  43 #ifdef PMIX_DISABLE_INLINE_ASM
  44 #undef PMIX_C_GCC_INLINE_ASSEMBLY
  45 #define PMIX_C_GCC_INLINE_ASSEMBLY 0
  46 #endif
  47 
  48 /* define PMIX_{GCC,DEC,XLC}_INLINE_ASSEMBLY based on the
  49    PMIX_{C,CXX}_{GCC,DEC,XLC}_INLINE_ASSEMBLY defines and whether we
  50    are in C or C++ */
  51 #if defined(c_plusplus) || defined(__cplusplus)
  52 #define PMIX_GCC_INLINE_ASSEMBLY PMIX_CXX_GCC_INLINE_ASSEMBLY
  53 #else
  54 #define PMIX_GCC_INLINE_ASSEMBLY PMIX_C_GCC_INLINE_ASSEMBLY
  55 #endif
  56 
  57 /**********************************************************************
  58  *
  59  * Load the appropriate architecture files and set some reasonable
  60  * default values for our support
  61  *
  62  *********************************************************************/
  63 
  64 /* By default we suppose all timers are monotonic per node. */
  65 #define PMIX_TIMER_MONOTONIC 1
  66 
  67 BEGIN_C_DECLS
  68 
  69 /* If you update this list, you probably also want to update
  70    pmix/mca/timer/linux/configure.m4.  Or not. */
  71 
  72 #if defined(DOXYGEN)
  73 /* don't include system-level gorp when generating doxygen files */
  74 #elif PMIX_ASSEMBLY_ARCH == PMIX_X86_64
  75 #include "src/atomics/sys/x86_64/timer.h"
  76 #elif PMIX_ASSEMBLY_ARCH == PMIX_ARM
  77 #include "src/atomics/sys/arm/timer.h"
  78 #elif PMIX_ASSEMBLY_ARCH == PMIX_ARM64
  79 #include "src/atomics/sys/arm64/timer.h"
  80 #elif PMIX_ASSEMBLY_ARCH == PMIX_IA32
  81 #include "src/atomics/sys/ia32/timer.h"
  82 #elif PMIX_ASSEMBLY_ARCH == PMIX_IA64
  83 #include "src/atomics/sys/ia64/timer.h"
  84 #elif PMIX_ASSEMBLY_ARCH == PMIX_POWERPC32
  85 #include "src/atomics/sys/powerpc/timer.h"
  86 #elif PMIX_ASSEMBLY_ARCH == PMIX_POWERPC64
  87 #include "src/atomics/sys/powerpc/timer.h"
  88 #elif PMIX_ASSEMBLY_ARCH == PMIX_SPARCV9_32
  89 #include "src/atomics/sys/sparcv9/timer.h"
  90 #elif PMIX_ASSEMBLY_ARCH == PMIX_SPARCV9_64
  91 #include "src/atomics/sys/sparcv9/timer.h"
  92 #elif PMIX_ASSEMBLY_ARCH == PMIX_MIPS
  93 #include "src/atomics/sys/mips/timer.h"
  94 #endif
  95 
  96 #ifndef DOXYGEN
  97 #ifndef PMIX_HAVE_SYS_TIMER_GET_CYCLES
  98 #define PMIX_HAVE_SYS_TIMER_GET_CYCLES 0
  99 
 100 typedef long pmix_timer_t;
 101 #endif
 102 #endif
 103 
 104 #ifndef PMIX_HAVE_SYS_TIMER_IS_MONOTONIC
 105 
 106 #define PMIX_HAVE_SYS_TIMER_IS_MONOTONIC 1
 107 
 108 static inline bool pmix_sys_timer_is_monotonic (void)
 109 {
 110     return PMIX_TIMER_MONOTONIC;
 111 }
 112 
 113 #endif
 114 
 115 END_C_DECLS
 116 
 117 #endif /* PMIX_SYS_TIMER_H */

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