From owner-dev-commits-src-all@freebsd.org Thu Jun 24 05:27:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B80665E28B; Thu, 24 Jun 2021 05:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9TD03Q4Qz57Qs; Thu, 24 Jun 2021 05:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39789124AA; Thu, 24 Jun 2021 05:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15O5RSnA000857; Thu, 24 Jun 2021 05:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15O5RS2m000856; Thu, 24 Jun 2021 05:27:28 GMT (envelope-from git) Date: Thu, 24 Jun 2021 05:27:28 GMT Message-Id: <202106240527.15O5RS2m000856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: e6caac717b4f - main - libsa: Add tslog support for arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6caac717b4fc2b87cf93f67109884e768253e77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2021 05:27:28 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e6caac717b4fc2b87cf93f67109884e768253e77 commit e6caac717b4fc2b87cf93f67109884e768253e77 Author: Colin Percival AuthorDate: 2021-06-24 05:21:23 +0000 Commit: Colin Percival CommitDate: 2021-06-24 05:21:23 +0000 libsa: Add tslog support for arm64 The original code only supported x86 and used rdtsc(); we now also support arm64 and use the CNTVCT_EL0 special register. --- stand/libsa/tslog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stand/libsa/tslog.c b/stand/libsa/tslog.c index 7ea18e0bb8f8..c6164aab02a9 100644 --- a/stand/libsa/tslog.c +++ b/stand/libsa/tslog.c @@ -29,7 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#if defined(__amd64__) || defined(__i386__) #include +#elif defined(__aarch64__) +#include +#endif #include @@ -60,6 +64,8 @@ tslog(const char * type, const char * f, const char * s) { #if defined(__amd64__) || defined(__i386__) uint64_t tsc = rdtsc(); +#elif defined(__aarch64__) + uint64_t tsc = READ_SPECIALREG(cntvct_el0); #else uint64_t tsc = 0; #endif