From nobody Mon Jul 04 16:40:11 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 727FC189426B; Mon, 4 Jul 2022 16:40:12 +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 4LcBP75HVbz4ST3; Mon, 4 Jul 2022 16:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656952812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vf2lzWE93Y4gHjJOHtHqlRDraZVKotBkis7kmpxCf7M=; b=OeimqmEKjxN3wxS4gFJJXyrteOkfbwA02Mn/8igqgNluyITJIv1RRfsewp0XDyrk0QFo8O Z+AZwwoRTRCbf1QfYxkp0Fv06zNXwiDdovKDnHOz1BX6l+GZ4l+9Hx1laSkD0gF+bUqC5Z w9b/jbnuBX3lwwujYdF9jZBKnsmRT9cR6pZHDDwrdPN/zowAfjqS+cPBt1tBn7MQZHxxXs 0jVsAYtHgSW55nRGt0kSiMX6PWVihgj65mRZshTWtwAy40ctYKydO4R5J+WvgL+ibNcHuB uNidzFvAs/V1pKANLCvCn3k3K91J1WhBLtLmz2DAqSGExtUqKUtvSoleoaQxSw== 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 6CF5514B25; Mon, 4 Jul 2022 16:40:11 +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 264GeBVP044638; Mon, 4 Jul 2022 16:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 264GeBOj044632; Mon, 4 Jul 2022 16:40:11 GMT (envelope-from git) Date: Mon, 4 Jul 2022 16:40:11 GMT Message-Id: <202207041640.264GeBOj044632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 11895d217690 - stable/13 - set_cputicker: use a bool List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11895d217690010a8ad6531844d7b61efe9f810d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656952812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vf2lzWE93Y4gHjJOHtHqlRDraZVKotBkis7kmpxCf7M=; b=pXGX/Ldmlxo6XlagbaUHBSNLFYA0GbXWangvHdJtuBDoyNJY60srSCO5B9bMrADKoxPSZ3 dncJRoIVTFYwi/86jS5JQysPuqa9UylnOOo76xL4bt+kstZJDZwbrPwPQV7B8dC2ZlcJPQ xhReRGA4edcsrHdJGbhsvSq7LKnGI8HIVwPVFLEtd1HBBL+o51vRPHo6werW1uDz6TTkHu IwKqZyjzDJcapaHsadEKOjdq3NiAdq8hccbykQoQGQn3KL3/6HTmqfIIAjxMrhpSEwAbBb ln0/bsVlGa38Q2NS4vs1QDFtvaFZ1yrviSFt0OilIsyySImuXmFhkiumGohpXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656952812; a=rsa-sha256; cv=none; b=xgLFtq+KpkXwXgQF5VtktgWnJpZXhPJdvS5RaL+xVnbS+oGPg9ysR0G9nbKeer9eRsyIaA xur2TCe8/hJUlgSueYWtpxav2fEEG5FkpmGsFDT9n3UjNj8QpD7/TD/abn/6+1B/8bdowM XSRdvLFp6xy5EpkvF8VRQMk5n5JVlshMqESdNAA9FulwVbQdJP7n1wqSvK1d78JmMZMbhq OVLZEp5ZAoHbmxKQSjfI20105ozVQT5YC5sHEqDJYb7942YTljdXcykVbP/BeKAKl8JDEO p399IyYmoFnVGB4FWgCLddJ+K+Kx9hOuGcbFfRW+S9QAhqp+z8h3i5yNVaXe5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=11895d217690010a8ad6531844d7b61efe9f810d commit 11895d217690010a8ad6531844d7b61efe9f810d Author: Mitchell Horne AuthorDate: 2022-06-21 16:22:26 +0000 Commit: Mitchell Horne CommitDate: 2022-07-04 16:37:05 +0000 set_cputicker: use a bool The third argument to this function indicates whether the supplied ticker is fixed or variable, i.e. requiring calibration. Give this argument a type and name that better conveys this purpose. Reviewed by: kib, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35459 (cherry picked from commit 8701571df9fad787f5833310cd696fe51e0cde6d) --- sys/i386/i386/geode.c | 2 +- sys/kern/kern_tc.c | 6 +++--- sys/powerpc/powerpc/clock.c | 2 +- sys/sys/systm.h | 2 +- sys/x86/x86/tsc.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/i386/i386/geode.c b/sys/i386/i386/geode.c index e97e98180b53..4d8bf0477abe 100644 --- a/sys/i386/i386/geode.c +++ b/sys/i386/i386/geode.c @@ -291,7 +291,7 @@ geode_probe(device_t self) tc_init(&geode_timecounter); EVENTHANDLER_REGISTER(watchdog_list, geode_watchdog, NULL, 0); - set_cputicker(geode_cputicks, 27000000, 0); + set_cputicker(geode_cputicks, 27000000, false); } break; case 0x0510100b: diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index bdbd19bc84f0..f06665a69488 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -2027,7 +2027,7 @@ SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_SECOND, inittimecounter, NULL); /* Cpu tick handling -------------------------------------------------*/ -static int cpu_tick_variable; +static bool cpu_tick_variable; static uint64_t cpu_tick_frequency; DPCPU_DEFINE_STATIC(uint64_t, tc_cpu_ticks_base); @@ -2120,14 +2120,14 @@ cpu_tick_calibrate(int reset) } void -set_cputicker(cpu_tick_f *func, uint64_t freq, unsigned var) +set_cputicker(cpu_tick_f *func, uint64_t freq, bool isvariable) { if (func == NULL) { cpu_ticks = tc_cpu_ticks; } else { cpu_tick_frequency = freq; - cpu_tick_variable = var; + cpu_tick_variable = isvariable; cpu_ticks = func; } } diff --git a/sys/powerpc/powerpc/clock.c b/sys/powerpc/powerpc/clock.c index a530d6c71a6b..46495108e5f1 100644 --- a/sys/powerpc/powerpc/clock.c +++ b/sys/powerpc/powerpc/clock.c @@ -190,7 +190,7 @@ decr_init(void) ticks_per_sec = platform_timebase_freq(&cpu); ps_per_tick = 1000000000000 / ticks_per_sec; - set_cputicker(mftb, ticks_per_sec, 0); + set_cputicker(mftb, ticks_per_sec, false); snprintf(buf, sizeof(buf), "cpu%d:decrementer", curcpu); intrcnt_add(buf, &decr_counts[curcpu]); decr_et_stop(NULL); diff --git a/sys/sys/systm.h b/sys/sys/systm.h index e2e4a30275e9..0820bdcde676 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -386,7 +386,7 @@ int getenv_array(const char *name, void *data, int size, int *psize, #define GETENV_SIGNED true /* negative numbers allowed */ typedef uint64_t (cpu_tick_f)(void); -void set_cputicker(cpu_tick_f *func, uint64_t freq, unsigned var); +void set_cputicker(cpu_tick_f *func, uint64_t freq, bool isvariable); extern cpu_tick_f *cpu_ticks; uint64_t cpu_tickrate(void); uint64_t cputick2usec(uint64_t tick); diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index e821246ae293..0dcee1967889 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -823,7 +823,7 @@ tsc_levels_changed(void *arg, int unit) error = CPUFREQ_LEVELS(cf_dev, levels, &count); if (error == 0 && count != 0) { max_freq = (uint64_t)levels[0].total_set.freq * 1000000; - set_cputicker(rdtsc, max_freq, 1); + set_cputicker(rdtsc, max_freq, true); } else printf("tsc_levels_changed: no max freq found\n"); free(levels, M_TEMP);