From owner-svn-src-head@freebsd.org Thu Jul 19 11:27:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ED6F102F543; Thu, 19 Jul 2018 11:27:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0121F8C069; Thu, 19 Jul 2018 11:27:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5EFB28899; Thu, 19 Jul 2018 11:27:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6JBRBjX067781; Thu, 19 Jul 2018 11:27:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6JBRB60067780; Thu, 19 Jul 2018 11:27:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807191127.w6JBRB60067780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 19 Jul 2018 11:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336476 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 336476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2018 11:27:12 -0000 Author: manu Date: Thu Jul 19 11:27:11 2018 New Revision: 336476 URL: https://svnweb.freebsd.org/changeset/base/336476 Log: arm: Implement cpu_est_clockrate for armv[67] Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/pcpu.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Jul 19 10:14:52 2018 (r336475) +++ head/sys/arm/arm/machdep.c Thu Jul 19 11:27:11 2018 (r336476) @@ -272,8 +272,22 @@ cpu_flush_dcache(void *ptr, size_t len) int cpu_est_clockrate(int cpu_id, uint64_t *rate) { +#if __ARM_ARCH >= 6 + struct pcpu *pc; + pc = pcpu_find(cpu_id); + if (pc == NULL || rate == NULL) + return (EINVAL); + + if (pc->pc_clock == 0) + return (EOPNOTSUPP); + + *rate = pc->pc_clock; + + return (0); +#else return (ENXIO); +#endif } void Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Thu Jul 19 10:14:52 2018 (r336475) +++ head/sys/arm/include/pcpu.h Thu Jul 19 11:27:11 2018 (r336476) @@ -65,7 +65,8 @@ struct vmspace; int pc_dbreg_cmd; \ int pc_bp_harden_kind; \ uint32_t pc_original_actlr; \ - char __pad[147] + uint64_t pc_clock; \ + char __pad[139] #else #define PCPU_MD_FIELDS \ char __pad[93]