Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 allow to read CNTVCT_EL0 and CNTFRQ...



details:   https://anonhg.NetBSD.org/src/rev/e4dce7e05040
branches:  trunk
changeset: 991349:e4dce7e05040
user:      ryo <ryo%NetBSD.org@localhost>
date:      Tue Jul 10 08:35:58 2018 +0000

description:
allow to read CNTVCT_EL0 and CNTFRQ_EL0 from EL0

diffstat:

 sys/arch/aarch64/aarch64/genassym.cf |  3 ++-
 sys/arch/aarch64/aarch64/locore.S    |  9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r c8eeb04b7fb8 -r e4dce7e05040 sys/arch/aarch64/aarch64/genassym.cf
--- a/sys/arch/aarch64/aarch64/genassym.cf      Tue Jul 10 08:20:29 2018 +0000
+++ b/sys/arch/aarch64/aarch64/genassym.cf      Tue Jul 10 08:35:58 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.3 2018/07/09 06:19:53 ryo Exp $
+# $NetBSD: genassym.cf,v 1.4 2018/07/10 08:35:58 ryo Exp $
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -264,6 +264,7 @@
 
 define CNTHCTL_EL1PCTEN        CNTHCTL_EL1PCTEN
 define CNTHCTL_EL1PCEN         CNTHCTL_EL1PCEN
+define CNTKCTL_EL0VCTEN        CNTKCTL_EL0VCTEN
 define SPSR_F                  SPSR_F
 define SPSR_I                  SPSR_I
 define SPSR_A                  SPSR_A
diff -r c8eeb04b7fb8 -r e4dce7e05040 sys/arch/aarch64/aarch64/locore.S
--- a/sys/arch/aarch64/aarch64/locore.S Tue Jul 10 08:20:29 2018 +0000
+++ b/sys/arch/aarch64/aarch64/locore.S Tue Jul 10 08:35:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.9 2018/07/10 08:20:29 ryo Exp $   */
+/*     $NetBSD: locore.S,v 1.10 2018/07/10 08:35:58 ryo Exp $  */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -36,7 +36,7 @@
 #include <aarch64/pte.h>
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.9 2018/07/10 08:20:29 ryo Exp $")
+RCSID("$NetBSD: locore.S,v 1.10 2018/07/10 08:35:58 ryo Exp $")
 
 /* #define DEBUG_LOCORE */
 /* #define DEBUG_MMU */
@@ -802,6 +802,11 @@
        /* No trap system register access, and Trap FP/SIMD access */
        msr     cpacr_el1, xzr
 
+       /* allow to read CNTVCT_EL0 and CNTFRQ_EL0 from EL0 */
+       mrs     x0, cntkctl_el1
+       orr     x0, x0, #CNTKCTL_EL0VCTEN
+       msr     cntkctl_el1, x0
+
        /* any exception not masked */
        msr     daif, xzr
 



Home | Main Index | Thread Index | Old Index