Merge pull request #1808 from abjoshi-brcm/timer_arm64
arm64: add timer support
Этот коммит содержится в:
Коммит
2992d6d238
2
AUTHORS
2
AUTHORS
@ -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
|
||||
individual who committed them.
|
||||
|
||||
Abhishek Joshi, Broadcom
|
||||
abhishek.joshi@broadcom.com
|
||||
Abhishek Kulkarni, Indiana University
|
||||
adkulkar@cs.indiana.edu
|
||||
Adrian Knoth, Friedrich-Schiller-Universitat Jena
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (c) 2008 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -20,14 +21,21 @@ static inline opal_timer_t
|
||||
opal_sys_timer_get_cycles(void)
|
||||
{
|
||||
opal_timer_t ret;
|
||||
struct tms accurate_clock;
|
||||
|
||||
times(&accurate_clock);
|
||||
ret = accurate_clock.tms_utime + accurate_clock.tms_stime;
|
||||
__asm__ __volatile__ ("mrs %0, CNTVCT_EL0" : "=r" (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
|
||||
|
||||
#endif /* ! OPAL_SYS_ARCH_TIMER_H */
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -84,6 +85,8 @@ BEGIN_C_DECLS
|
||||
#include "opal/sys/amd64/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_ARM
|
||||
#include "opal/sys/arm/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_ARM64
|
||||
#include "opal/sys/arm64/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_IA32
|
||||
#include "opal/sys/ia32/timer.h"
|
||||
#elif OPAL_ASSEMBLY_ARCH == OPAL_IA64
|
||||
|
@ -13,6 +13,7 @@
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2015 Research Organization for Information Science
|
||||
# and Technology (RIST). All rights reserved.
|
||||
# Copyright (c) 2016 Broadcom Limited. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -46,7 +47,7 @@ AC_DEFUN([MCA_opal_timer_linux_CONFIG],[
|
||||
[timer_linux_happy="no"])])
|
||||
|
||||
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 -r "/proc/cpuinfo"],
|
||||
[timer_linux_happy="yes"],
|
||||
|
@ -15,6 +15,7 @@
|
||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Broadcom Limited. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -107,6 +108,10 @@ static int opal_timer_linux_find_freq(void)
|
||||
|
||||
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) {
|
||||
/* first, look for a timebase field. probably only on PPC,
|
||||
but one never knows */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user