* [Xenomai-core] [PATCH] x86_64: Provide intermediate timer frequency API
@ 2007-11-12 23:05 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2007-11-12 23:05 UTC (permalink / raw)
To: adeos-main; +Cc: Xenomai-core
[-- 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 --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-12 23:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12 23:05 [Xenomai-core] [PATCH] x86_64: Provide intermediate timer frequency API Jan Kiszka
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.