From owner-freebsd-current Thu Jul 8 3: 1: 5 1999 Delivered-To: freebsd-current@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 4BD851514C; Thu, 8 Jul 1999 03:00:55 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id LAA88985; Thu, 8 Jul 1999 11:00:25 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 8 Jul 1999 11:00:24 +0100 (BST) From: Doug Rabson To: Seigo Tanimura Cc: julian@whistle.com, freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: Rewriting pca(4) using finetimer(9) (was: Re: MPU401 now worksunder New Midi Driver Framework with a Fine Timer) In-Reply-To: <199907080940.SAA26649@rina.naklab.dnj.ynu.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 8 Jul 1999, Seigo Tanimura wrote: > On Thu, 8 Jul 1999 09:54:42 +0100 (BST), > Doug Rabson said: > > dfr> If I understand this correctly, you are suggesting that we program timer0 > dfr> so that we only take interrupts when a finetimer is due to fire? If so, > dfr> then it sounds very good. The idea of taking 6000+ interrupts/sec made me > dfr> uneasy, even though most would return without doing any work. > > > Yes, that is what I am doing now. And some further discussion... > > > t' > \sum_(k=0)^(j) dt_rem(c_k) > > > > where the right hand side of the inequality is the time span after which > > the callout c_k is made. Then c' is inserted after c_j and new dt_rem(c_(j+1)) > > and dt_rem(c_(j+2)) are determined. Now we can acquire_timer0() with dt_rem(c_0). > > If t' is less than dt_rem(c_0) then we have no feasible j. This is the case > in which we must reaquire_timer0() using t'. Then, after interting c', dt_rem(c_1) > is updated to be (dt_rem(c_1) - (time elapsed since the last aquire_timer0())), > so that c_1 can be armed later. > > > There is one problem in this method. acquire_timer0() is only implemented > for i386. We would need to write something equivalent for alpha... The timer hardware on the alpha is essentially the same but the interrupts are wired up differently. I'm not sure how hard it would be to get timer0 working but I think it should be possible. The alphas tend to run the main clock quite fast (typically 1024hz) so the granularity of timing is better but probably not good enough for midi or pca. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message