SMP - Only a single APIC timer handler

- bsp_timer_int_handler() and ap_timer_int_handler() unified into
  timer_int_handler()

- global realtime updated only on BSP
This commit is contained in:
Tomas Hruby
2010-09-15 14:10:09 +00:00
parent 85cca7096f
commit b7aed08e65
6 changed files with 100 additions and 115 deletions

View File

@@ -484,6 +484,7 @@ PRIVATE void apic_calibrate_clocks(unsigned cpu)
}
intr_disable();
BKL_LOCK();
/* remove the probe */
rm_irq_handler(&calib_clk);
@@ -613,6 +614,8 @@ PRIVATE int lapic_enable_in_msr(void)
ia32_msr_read(IA32_APIC_BASE, &msr.hi, &msr.lo);
#if 0
/*FIXME this is a problem on AP */
/*
* FIXME if the location is different (unlikely) then the one we expect,
* update it
@@ -625,6 +628,7 @@ PRIVATE int lapic_enable_in_msr(void)
}
lapic_addr = phys2vir(msr.lo & ~((1 << 12) - 1));
}
#endif
msr.lo |= (1 << IA32_APIC_BASE_ENABLE_BIT);
ia32_msr_write(IA32_APIC_BASE, msr.hi, msr.lo);
@@ -825,7 +829,6 @@ PUBLIC void apic_idt_init(const int reset)
/* Set up idt tables for smp mode.
*/
vir_bytes local_timer_intr_handler;
int is_bsp = is_boot_apic(apicid());
if (reset) {
@@ -861,16 +864,12 @@ PUBLIC void apic_idt_init(const int reset)
/* configure the timer interupt handler */
if (is_bsp) {
local_timer_intr_handler = (vir_bytes) lapic_bsp_timer_int_handler;
BOOT_VERBOSE(printf("Initiating BSP timer handler\n"));
} else {
local_timer_intr_handler = (vir_bytes) lapic_ap_timer_int_handler;
BOOT_VERBOSE(printf("Initiating AP timer handler\n"));
BOOT_VERBOSE(printf("Initiating APIC timer handler\n"));
/* register the timer interrupt handler for this CPU */
int_gate(APIC_TIMER_INT_VECTOR, (vir_bytes) lapic_timer_int_handler,
PRESENT | INT_GATE_TYPE | (INTR_PRIVILEGE << DPL_SHIFT));
}
/* register the timer interrupt handler for this CPU */
int_gate(APIC_TIMER_INT_VECTOR, (vir_bytes) local_timer_intr_handler,
PRESENT | INT_GATE_TYPE | (INTR_PRIVILEGE << DPL_SHIFT));
}
PRIVATE int acpi_get_ioapics(struct io_apic * ioa, unsigned * nioa, unsigned max)

View File

@@ -64,11 +64,8 @@ ENTRY(apic_hwint##irq) \
iret ;
/* apic timer tick handlers */
ENTRY(lapic_bsp_timer_int_handler)
lapic_intr(_C_LABEL(bsp_timer_int_handler))
ENTRY(lapic_ap_timer_int_handler)
lapic_intr(_C_LABEL(ap_timer_int_handler))
ENTRY(lapic_timer_int_handler)
lapic_intr(_C_LABEL(timer_int_handler))
#ifdef CONFIG_SMP
#include "arch_smp.h"

View File

@@ -71,8 +71,7 @@ _PROTOTYPE( void apic_hwint62, (void) );
_PROTOTYPE( void apic_hwint63, (void) );
/* The local APIC timer tick handlers */
_PROTOTYPE(void lapic_bsp_timer_int_handler, (void));
_PROTOTYPE(void lapic_ap_timer_int_handler, (void));
_PROTOTYPE(void lapic_timer_int_handler, (void));
#endif

View File

@@ -1,6 +1,8 @@
#ifndef __CLOCK_X86_H__
#define __CLOCK_X86_H__
#include "../apic_asm.h"
_PROTOTYPE(int init_8253A_timer, (unsigned freq));
_PROTOTYPE(void stop_8253A_timer, (void));