All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oleg I. Vdovikin" <vdovikin@jscc.ru>
To: "Jeff Garzik" <jgarzik@mandrakesoft.com>
Cc: "Richard Henderson" <rth@twiddle.net>,
	"Ivan Kokshaysky" <ink@jurassic.park.msu.ru>, <alan@redhat.com>,
	<torvalds@transmeta.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [patch] Re: alpha - generic_init_pit - why using RTC for   calibration?
Date: Fri, 6 Jul 2001 12:45:35 +0400	[thread overview]
Message-ID: <003701c105f8$06bb6fe0$4d28d0c3@jscc.ru> (raw)
In-Reply-To: <022901c10095$f4fca650$4d28d0c3@jscc.ru> <20010629211931.A582@jurassic.park.msu.ru> <20010704114530.A1030@twiddle.net> <003e01c10522$1c9cf580$4d28d0c3@jscc.ru> <3B441618.638A3FC@mandrakesoft.com> <00a001c1052d$a3201320$4d28d0c3@jscc.ru> <3B4429AA.208BB183@mandrakesoft.com>

Jeff,

    The things are pretty simple (HZ - in real should be "Hz", cause HZ are
fixed for Alpha, HZ = 1024 Hz) :
        Hz = cc / calibration_time

    cc == rpcc() at end - rpcc() at begin
    calibration_time = (CLOCK_TICK_RATE / CALIBRATE_LATCH).

    So there is nothing wrong - clock ticks with CLOCK_TICK_RATE and we've a
divisor equal to CALIBRATE_LATCH. So the time interval elapses after
(CLOCK_TICK_RATE / CALIBRATE_LATCH) seconds and the CPU performs 'cc'
cycles.

    That's all. And these really works. ;-))

    About x86 style code - don't forget what LATCH defined as follows in
linux/timex.h:

#define LATCH  ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */

Regards,
    Oleg.

> Oleg,
>
> How is this relative to HZ, when you remove all references to HZ?
>
> > -#define CALIBRATE_LATCH        (52 * LATCH)
> > -#define CALIBRATE_TIME (52 * 1000020 / HZ)
> > +#define CALIBRATE_LATCH        0xffff
> [...]
> > +       /* and the final result in HZ */
> > +       return ((unsigned long)cc * CLOCK_TICK_RATE) / CALIBRATE_LATCH;
>
> and in asm-alpha/timex.h,
> > #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
>
> --
> Jeff Garzik      | Thalidomide, eh?
> Building 1024    | So you're saying the eggplant has an accomplice?
> MandrakeSoft     |
>


  reply	other threads:[~2001-07-06  8:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29 12:20 alpha - generic_init_pit - why using RTC for calibration? Oleg I. Vdovikin
2001-06-29 17:19 ` Ivan Kokshaysky
2001-07-02  9:52   ` Oleg I. Vdovikin
2001-07-03 13:06     ` Oleg I. Vdovikin
2001-07-04 18:45   ` [patch] " Richard Henderson
2001-07-05  7:14     ` Oleg I. Vdovikin
     [not found]       ` <3B441618.638A3FC@mandrakesoft.com>
2001-07-05  8:36         ` Oleg I. Vdovikin
2001-07-05  8:47           ` Jeff Garzik
2001-07-06  8:45             ` Oleg I. Vdovikin [this message]
2001-07-05  9:43       ` Ivan Kokshaysky
2001-07-06  9:03         ` Oleg I. Vdovikin
2001-07-06 12:00           ` Ivan Kokshaysky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003701c105f8$06bb6fe0$4d28d0c3@jscc.ru' \
    --to=vdovikin@jscc.ru \
    --cc=alan@redhat.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.