All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: adeos-main@gna.org
Cc: Xenomai-core@domain.hid
Subject: [Xenomai-core] [PATCH] x86_64: Provide intermediate timer frequency API
Date: Tue, 13 Nov 2007 00:05:50 +0100	[thread overview]
Message-ID: <4738DC4E.4050202@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 370 bytes --]

This patch introduces the intermediate IPIPE_APIC_TIMER_FREQ API, that
can be used by I-pipe users to obtain the accurate APIC timer frequency
as Linux calibrated it. This API is scheduled to be removed with
x86-ipipe for kernel 2.6.24. ipipe_request_tickdev is meant to be used then.

Note that a similar patch can be cooked up for 2.6.20-i386 if desired.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: provide-IPIPE_APIC_TIMER_FREQ.patch --]
[-- Type: text/x-patch; name="provide-IPIPE_APIC_TIMER_FREQ.patch", Size: 1867 bytes --]

---
 arch/x86_64/kernel/apic.c  |    3 +++
 arch/x86_64/kernel/ipipe.c |    1 +
 include/asm-x86_64/ipipe.h |    4 ++++
 3 files changed, 8 insertions(+)

Index: linux-2.6.23.1-xeno_64/arch/x86_64/kernel/apic.c
===================================================================
--- linux-2.6.23.1-xeno_64.orig/arch/x86_64/kernel/apic.c
+++ linux-2.6.23.1-xeno_64/arch/x86_64/kernel/apic.c
@@ -872,6 +872,9 @@ static int __init calibrate_APIC_clock(v
 
 	printk(KERN_INFO "Detected %d.%03d MHz APIC timer.\n",
 		result / 1000 / 1000, result / 1000 % 1000);
+#ifdef CONFIG_IPIPE
+	__ipipe_apic_timer_freq = result;
+#endif
 
 	return result * APIC_DIVISOR / HZ;
 }
Index: linux-2.6.23.1-xeno_64/arch/x86_64/kernel/ipipe.c
===================================================================
--- linux-2.6.23.1-xeno_64.orig/arch/x86_64/kernel/ipipe.c
+++ linux-2.6.23.1-xeno_64/arch/x86_64/kernel/ipipe.c
@@ -47,6 +47,7 @@
 asmlinkage void preempt_schedule_irq(void);
 
 int __ipipe_tick_irq;		/* =0: 8254 */
+unsigned long __ipipe_apic_timer_freq;
 
 DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
 
Index: linux-2.6.23.1-xeno_64/include/asm-x86_64/ipipe.h
===================================================================
--- linux-2.6.23.1-xeno_64.orig/include/asm-x86_64/ipipe.h
+++ linux-2.6.23.1-xeno_64/include/asm-x86_64/ipipe.h
@@ -84,6 +84,10 @@ extern unsigned cpu_khz;
 #define ipipe_tsc2ns(t)	(((t) * 1000UL) / (ipipe_cpu_freq() / 1000000UL))
 #define ipipe_tsc2us(t)	((t) / (ipipe_cpu_freq() / 1000000UL))
 
+/* Intermediat interface, will be removed in 2.6.24 in favour of ipipe_request_tickdev */
+extern unsigned long __ipipe_apic_timer_freq;
+#define IPIPE_APIC_TIMER_FREQ		__ipipe_apic_timer_freq
+
 /* Private interface -- Internal use only */
 
 #define __ipipe_check_platform()	do { } while(0)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

                 reply	other threads:[~2007-11-12 23:05 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=4738DC4E.4050202@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.