Received: by mail.netbsd.org (Postfix, from userid 605) id 437F284E1D; Wed, 1 Jan 2020 21:09:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id AC9E384DCE for ; Wed, 1 Jan 2020 21:09:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 4eELHkWog_Ts for ; Wed, 1 Jan 2020 21:09:12 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 40B6A84CD5 for ; Wed, 1 Jan 2020 21:09:12 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 3A00CFA97; Wed, 1 Jan 2020 21:09:12 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 1 Jan 2020 21:09:12 +0000 From: "Jason R Thorpe" Subject: CVS commit: src/sys To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20200101210912.3A00CFA97@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Jason R Thorpe" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: thorpej Date: Wed Jan 1 21:09:12 UTC 2020 Modified Files: src/sys/dev: clock_subr.h src/sys/kern: init_main.c kern_todr.c Log Message: First steps towards properly serializing access to the TOD clock. - Add a mutex around the TODR, and provide lock/unlock/lock-owned functions to manipulate it. - Rename inittodr() to todr_set_systime() and resettodr() to todr_save_systime() to better reflect what they do. These functions are intended to be called with the TODR lock held, which will allow for a pattern like: -> todr_lock() -> todr_save_systime() -> [do machine-dependent stuff to sleep/suspend] -> [magically awaken] -> todr_set_systime(...) -> todr_unlock() - Provide historically-named wrappers inittodr() and resettodr() that do the dance of acquiring / releasing the lock around the actual substance. NOTE: resettodr()'s use of the TODR lock is currently disabled (and todr_save_systime() does not assert it's held) until such time as issues around shutdown / reboot under duress can be addressed. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/clock_subr.h cvs rdiff -u -r1.514 -r1.515 src/sys/kern/init_main.c cvs rdiff -u -r1.43 -r1.44 src/sys/kern/kern_todr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.