Let the compiler optimize the timer_ack magic away in the 32bit timer
interrupt and put the same code into time_64.c. It's optimized out for
CONFIG_X86_IO_APIC on 32bit and for 64bit because timer_ack is const 0
in both cases.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
unsigned long long native_sched_clock(void);
unsigned long native_calibrate_tsc(void);
unsigned long long native_sched_clock(void);
unsigned long native_calibrate_tsc(void);
+extern int recalibrate_cpu_khz(void);
+#if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC)
+#else
+# define timer_ack (0)
-extern int recalibrate_cpu_khz(void);
extern int no_timer_check;
extern int no_timer_check;
#include <asm/time.h>
#include <asm/nmi.h>
#include <asm/time.h>
#include <asm/nmi.h>
+#if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC)
unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long profile_pc(struct pt_regs *regs)
{
/* Keep nmi watchdog up to date */
inc_irq_stat(irq0_irqs);
/* Keep nmi watchdog up to date */
inc_irq_stat(irq0_irqs);
-#ifdef CONFIG_X86_IO_APIC
+ /* Optimized out for !IO_APIC and x86_64 */
if (timer_ack) {
/*
* Subtle, when I/O APICs are used we have to ack timer IRQ
if (timer_ack) {
/*
* Subtle, when I/O APICs are used we have to ack timer IRQ
inb(PIC_MASTER_POLL);
spin_unlock(&i8259A_lock);
}
inb(PIC_MASTER_POLL);
spin_unlock(&i8259A_lock);
}
global_clock_event->event_handler(global_clock_event);
global_clock_event->event_handler(global_clock_event);
{
inc_irq_stat(irq0_irqs);
{
inc_irq_stat(irq0_irqs);
+ /* Optimized out for !IO_APIC and x86_64 */
+ if (timer_ack) {
+ /*
+ * Subtle, when I/O APICs are used we have to ack timer IRQ
+ * manually to deassert NMI lines for the watchdog if run
+ * on an 82489DX-based system.
+ */
+ spin_lock(&i8259A_lock);
+ outb(0x0c, PIC_MASTER_OCW3);
+ /* Ack the IRQ; AEOI will end it automatically. */
+ inb(PIC_MASTER_POLL);
+ spin_unlock(&i8259A_lock);
+ }
+
global_clock_event->event_handler(global_clock_event);
#ifdef CONFIG_MCA
global_clock_event->event_handler(global_clock_event);
#ifdef CONFIG_MCA