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
---
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)
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Adeos-main mailing list [email protected] https://mail.gna.org/listinfo/adeos-main
