From owner-freebsd-arch Fri Nov 17 0: 6: 0 2000 Delivered-To: freebsd-arch@freebsd.org Received: from inetfw.sonycsl.co.jp (inetfw.SonyCSL.CO.JP [203.137.129.4]) by hub.freebsd.org (Postfix) with ESMTP id 9872637B479 for ; Fri, 17 Nov 2000 00:05:58 -0800 (PST) Received: from hotaka.csl.sony.co.jp (hotaka.csl.sony.co.jp [43.27.98.57]) by inetfw.sonycsl.co.jp (8.9.3+3.2W/3.7Ws3/inetfw/2000050701/smtpfeed 1.07) with ESMTP id RAA47240; Fri, 17 Nov 2000 17:05:41 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by hotaka.csl.sony.co.jp (8.9.3+3.2W/3.7Ws3/hotaka/2000061722) with ESMTP id RAA29883; Fri, 17 Nov 2000 17:05:41 +0900 (JST) To: mark@grondar.za Cc: arch@freebsd.org Subject: Re: new monotime() call for all architectures. In-Reply-To: <200011170655.eAH6tCJ05746@gratis.grondar.za> References: <200011170655.eAH6tCJ05746@gratis.grondar.za> X-Mailer: Mew version 1.94.2 on Emacs 20.6 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001117170541F.kjc@csl.sony.co.jp> Date: Fri, 17 Nov 2000 17:05:41 +0900 From: Kenjiro Cho X-Dispatcher: imput version 20000228(IM140) Lines: 24 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Mark Murray wrote: > I need a fast-as-possible "time" inside the kernel to help > speed up the /dev/random device. I say "time", because although > it needs to be a function of time (preferably accurate and linear), > it has no need whatsoever to be "real time", so a simple counter > is quite OK. > > Pentiums, Alphas and IA64's all have a suitable register on chip, > while I have to make do with nanotime(9) on i386 and i486. > > I have prepared a monotime(9) call for the i386, alpha and ia64 > architectures (patch enclosed). I have been running this for a > week or two now with promising results (on a Pentium). With > the exception of the minimum of "glue" (and nanotime on older > architectures), these functions reduce to one instruction. > > Comments? Suggestions? Nobel Prize nominations? I'd like to > commit this soonish if possible. The PCC (Processor Cycle Counter) register on alpha is 64 bits but only the lower 32 bits is a counter. -Kenjiro To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message