All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Fries <dfries@mail.win.org>
To: John Weber <john@worldwideweber.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: how to get cpu_khz?
Date: Mon, 17 Sep 2001 14:51:30 -0500	[thread overview]
Message-ID: <20010917145130.C4041@aerospace.fries.net> (raw)
In-Reply-To: <fa.ginsptv.1gg45b5@ifi.uio.no> <3BA64ADE.999E1402@worldwideweber.org>
In-Reply-To: <3BA64ADE.999E1402@worldwideweber.org>

On Mon, Sep 17, 2001 at 03:11:26PM -0400, John Weber wrote:
> David Fries wrote:
> > 
> > I'm using the TSC of the Pentium processors to get some precise timing
> > delays for writing to a eeprom (bit banging bus operations), and it
> > works just fine, but the cpu_khz variable isn't exported to a kernel
> > module, so I hardcoded in my module.  It works fine for that one
> > system, but obviously I don't want to hard code it for the general
> > case.  I guess I could write my own routine to figure out what the
> > cpu_khz is, but it is already done, so how do I get access to it?
> 
> I don't know of any official way of doing this, but here's some 
> code (written by aa) that accomplishes this.

For a user space program you could just read /proc/cpuinfo, I'm
actually writing a kernel driver, maybe I wasn't clear enough.  I'm
just frustrated because the variable I'm after, cpu_khz is already
calculated at boot time (that's where /proc/cpuinfo gets its data) and
that variable doesn't appear to be exported to the rest of the kernel,
either that or I'm just missing something, which I would rather be the
case at this point.

-- 
		+---------------------------------+
		|      David Fries                |
		|      dfries@mail.win.org        |
		+---------------------------------+

  reply	other threads:[~2001-09-17 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.ginsptv.1gg45b5@ifi.uio.no>
2001-09-17 19:11 ` how to get cpu_khz? John Weber
2001-09-17 19:51   ` David Fries [this message]
2001-09-17 19:58     ` Richard B. Johnson
2001-09-17 21:26       ` Alan Cox
2001-09-17 16:43 David Fries

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=20010917145130.C4041@aerospace.fries.net \
    --to=dfries@mail.win.org \
    --cc=john@worldwideweber.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.