From: Jan Kiszka <jan.kiszka@domain.hid>
To: adeos-main@gna.org
Cc: Xenomai-core@domain.hid
Subject: [Xenomai-core] [PATCH 1/2] i386: report timer frequency on tickdev take-over
Date: Tue, 13 Nov 2007 00:03:02 +0100 [thread overview]
Message-ID: <4738DBA6.8020608@domain.hid> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 469 bytes --]
Here comes my favourite approach to report the frequency of the timer
that an I-pipe user takes over: via the very same API. This patch
extends ipipe_request_tickdev by a pointer to a variable that shall
receive the timer frequency as the hijacked clock_event_device carries it.
This is the most generic, future-proof, and clean approach IMHO, because
it doesn't assume anything about the tickdev selection the user may make
when requesting the device.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: report-tickdev-freq-i386.patch --]
[-- Type: text/x-patch; name="report-tickdev-freq-i386.patch", Size: 1720 bytes --]
---
include/linux/ipipe_tickdev.h | 2 +-
kernel/ipipe/core.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
Index: linux-2.6.23-ipipe/include/linux/ipipe_tickdev.h
===================================================================
--- linux-2.6.23-ipipe.orig/include/linux/ipipe_tickdev.h
+++ linux-2.6.23-ipipe/include/linux/ipipe_tickdev.h
@@ -46,7 +46,7 @@ int ipipe_request_tickdev(const char *de
struct ipipe_tick_device *tdev),
int (*emutick)(unsigned long evt,
struct ipipe_tick_device *tdev),
- int cpu);
+ int cpu, unsigned long *tick_freq);
void ipipe_release_tickdev(int cpu);
Index: linux-2.6.23-ipipe/kernel/ipipe/core.c
===================================================================
--- linux-2.6.23-ipipe.orig/kernel/ipipe/core.c
+++ linux-2.6.23-ipipe/kernel/ipipe/core.c
@@ -123,10 +123,11 @@ int ipipe_request_tickdev(const char *de
struct ipipe_tick_device *tdev),
int (*emutick)(unsigned long delta,
struct ipipe_tick_device *tdev),
- int cpu)
+ int cpu, unsigned long *tick_freq)
{
struct ipipe_tick_device *itd;
struct tick_device *slave;
+ unsigned long long freq;
unsigned long flags;
int status;
@@ -170,6 +171,8 @@ int ipipe_request_tickdev(const char *de
itd->emul_set_tick = emutick;
itd->real_set_mode = slave->evtdev->set_mode;
itd->real_set_tick = slave->evtdev->set_next_event;
+ freq = (1000000000ULL * slave->evtdev->mult) >> slave->evtdev->shift;
+ *tick_freq = (unsigned long)freq;
slave->evtdev->set_mode = __ipipe_set_tick_mode;
slave->evtdev->set_next_event = __ipipe_set_next_tick;
status = slave->evtdev->mode;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
reply other threads:[~2007-11-12 23:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4738DBA6.8020608@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Xenomai-core@domain.hid \
--cc=adeos-main@gna.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.