From: Martin Waitz <tali@admingilde.org>
To: john stultz <johnstul@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] new timeofday core subsystem (v.A1)
Date: Wed, 8 Dec 2004 21:27:13 +0100 [thread overview]
Message-ID: <20041208202713.GA4663@admingilde.org> (raw)
In-Reply-To: <1102470997.1281.30.camel@cog.beaverton.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]
hoi :)
On Tue, Dec 07, 2004 at 05:56:38PM -0800, john stultz wrote:
> +struct timesource_t {
usually only typedefs end with _t
> + char* name;
> + int priority;
> + enum {
> + TIMESOURCE_FUNCTION,
> + TIMESOURCE_MMIO_32,
> + TIMESOURCE_MMIO_64
> + } type;
> + cycle_t (*read_fnct)(void);
> + void* ptr;
This could be made __iomem if it is intended to point to an IO memory region.
Hmm, but then there is no ioread64, so I guess I'm wrong.
> + cycle_t mask;
> + u32 mult;
> + u32 shift;
> +};
> +static inline nsec_t cyc2ns(struct timesource_t* ts, cycle_t cycles, cycle_t* rem)
> +{
> + u64 ret;
> + ret = (u64)cycles;
> + ret *= ts->mult;
> + ret >>= ts->shift;
> + if (rem) /* XXX we still need to do remainder math */
> + *rem = (cycle_t)0;
> + return (nsec_t)ret;
> +}
well, the math is simple:
if (rem) *rem = ret & (1 << ts->shift -1);
ret >>= ts->shift;
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-12-08 20:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-08 1:55 [RFC] New timeofday proposal (v.A1) john stultz
2004-12-08 1:56 ` [RFC] new timeofday core subsystem (v.A1) john stultz
2004-12-08 1:57 ` [RFC] new timeofday arch specific hooks (v.A1) john stultz
2004-12-08 1:58 ` [RFC] new timeofday timesources (v.A1) john stultz
2004-12-08 2:02 ` john stultz
2004-12-08 9:17 ` [RFC] new timeofday core subsystem (v.A1) Pavel Machek
2004-12-08 18:44 ` Christoph Lameter
2004-12-08 19:22 ` john stultz
2004-12-08 18:53 ` Christoph Lameter
2004-12-08 20:27 ` Martin Waitz [this message]
[not found] ` <1102555933.1281.301.camel@cog.beaverton.ibm.com>
2004-12-09 7:32 ` Martin Waitz
2004-12-08 18:25 ` [RFC] New timeofday proposal (v.A1) Christoph Lameter
2004-12-08 19:11 ` john stultz
2004-12-08 19:20 ` Christoph Lameter
2004-12-08 19:58 ` john stultz
2004-12-08 20:14 ` Christoph Lameter
2004-12-08 21:25 ` George Anzinger
2004-12-08 23:47 ` Christoph Lameter
2004-12-08 23:36 ` john stultz
2004-12-08 23:53 ` Christoph Lameter
2004-12-09 0:17 ` john stultz
2004-12-09 0:40 ` Christoph Lameter
2004-12-09 0:51 ` john stultz
2004-12-09 1:24 ` Christoph Lameter
2004-12-09 7:57 ` Ulrich Windl
2004-12-09 8:29 ` john stultz
2004-12-09 7:47 ` Ulrich Windl
2004-12-08 18:43 ` Nicolas Pitre
2004-12-08 18:57 ` john stultz
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=20041208202713.GA4663@admingilde.org \
--to=tali@admingilde.org \
--cc=johnstul@us.ibm.com \
--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.