1
1
Signed-off-by: Sreenidhi Bharathkar Ramesh <sreenidhi-bharathkar.ramesh@broadcom.com>
Этот коммит содержится в:
Abhishek Joshi 2016-06-21 10:25:28 +00:00
родитель 46406914c5
Коммит f06f7eb3e6
5 изменённых файлов: 23 добавлений и 4 удалений

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

@ -8,6 +8,8 @@ Github.com pull request). Note that these email addresses are not
guaranteed to be current; they are simply a unique indicator of the guaranteed to be current; they are simply a unique indicator of the
individual who committed them. individual who committed them.
Abhishek Joshi, Broadcom
abhishek.joshi@broadcom.com
Abhishek Kulkarni, Indiana University Abhishek Kulkarni, Indiana University
adkulkar@cs.indiana.edu adkulkar@cs.indiana.edu
Adrian Knoth, Friedrich-Schiller-Universitat Jena Adrian Knoth, Friedrich-Schiller-Universitat Jena

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

@ -2,6 +2,7 @@
* Copyright (c) 2008 The University of Tennessee and The University * Copyright (c) 2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -20,14 +21,21 @@ static inline opal_timer_t
opal_sys_timer_get_cycles(void) opal_sys_timer_get_cycles(void)
{ {
opal_timer_t ret; opal_timer_t ret;
struct tms accurate_clock;
times(&accurate_clock); __asm__ __volatile__ ("mrs %0, CNTVCT_EL0" : "=r" (ret));
ret = accurate_clock.tms_utime + accurate_clock.tms_stime;
return ret; return ret;
} }
static inline opal_timer_t
opal_sys_timer_freq(void)
{
opal_timer_t freq;
__asm__ __volatile__ ("mrs %0, CNTFRQ_EL0" : "=r" (freq));
return (opal_timer_t)(freq);
}
#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1 #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 1
#endif /* ! OPAL_SYS_ARCH_TIMER_H */ #endif /* ! OPAL_SYS_ARCH_TIMER_H */

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -84,6 +85,8 @@ BEGIN_C_DECLS
#include "opal/sys/amd64/timer.h" #include "opal/sys/amd64/timer.h"
#elif OPAL_ASSEMBLY_ARCH == OPAL_ARM #elif OPAL_ASSEMBLY_ARCH == OPAL_ARM
#include "opal/sys/arm/timer.h" #include "opal/sys/arm/timer.h"
#elif OPAL_ASSEMBLY_ARCH == OPAL_ARM64
#include "opal/sys/arm64/timer.h"
#elif OPAL_ASSEMBLY_ARCH == OPAL_IA32 #elif OPAL_ASSEMBLY_ARCH == OPAL_IA32
#include "opal/sys/ia32/timer.h" #include "opal/sys/ia32/timer.h"
#elif OPAL_ASSEMBLY_ARCH == OPAL_IA64 #elif OPAL_ASSEMBLY_ARCH == OPAL_IA64

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

@ -13,6 +13,7 @@
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science # Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved. # and Technology (RIST). All rights reserved.
# Copyright (c) 2016 Broadcom Limited. All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
# Additional copyrights may follow # Additional copyrights may follow
@ -46,7 +47,7 @@ AC_DEFUN([MCA_opal_timer_linux_CONFIG],[
[timer_linux_happy="no"])]) [timer_linux_happy="no"])])
case "${host}" in case "${host}" in
i?86-*linux*|x86_64*linux*|ia64-*linux*|powerpc-*linux*|powerpc64-*linux*|sparc*-*linux*) i?86-*linux*|x86_64*linux*|ia64-*linux*|powerpc-*linux*|powerpc64-*linux*|sparc*-*linux*|aarch64-*linux*)
AS_IF([test "$timer_linux_happy" = "yes"], AS_IF([test "$timer_linux_happy" = "yes"],
[AS_IF([test -r "/proc/cpuinfo"], [AS_IF([test -r "/proc/cpuinfo"],
[timer_linux_happy="yes"], [timer_linux_happy="yes"],

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

@ -15,6 +15,7 @@
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -107,6 +108,10 @@ static int opal_timer_linux_find_freq(void)
opal_timer_linux_freq = 0; opal_timer_linux_freq = 0;
#if OPAL_ASSEMBLY_ARCH == OPAL_ARM64
opal_timer_linux_freq = opal_sys_timer_freq();
#endif
if (0 == opal_timer_linux_freq) { if (0 == opal_timer_linux_freq) {
/* first, look for a timebase field. probably only on PPC, /* first, look for a timebase field. probably only on PPC,
but one never knows */ but one never knows */