summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-06-20 21:33:29 +0000
committermav <mav@FreeBSD.org>2010-06-20 21:33:29 +0000
commitd1175426d7bcb8aeacdb7416e281e63e668da297 (patch)
tree0950027f8a4d7f49ad3b3ae792b390e08763c5c5 /sys/i386
parent75f3660605fcdf678edb8498311bba6ec652af82 (diff)
downloadFreeBSD-src-d1175426d7bcb8aeacdb7416e281e63e668da297.zip
FreeBSD-src-d1175426d7bcb8aeacdb7416e281e63e668da297.tar.gz
Implement new event timers infrastructure. It provides unified APIs for
writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/mp_machdep.c3
-rw-r--r--sys/i386/include/apicvar.h7
2 files changed, 2 insertions, 8 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 70f69271..4e3ec3e 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -728,10 +728,11 @@ init_secondary(void)
}
mtx_unlock_spin(&ap_boot_mtx);
-
/* wait until all the AP's are up */
while (smp_started == 0)
ia32_pause();
+ /* Start per-CPU event timers. */
+ cpu_initclocks_ap();
/* enter the scheduler */
sched_throw(NULL);
diff --git a/sys/i386/include/apicvar.h b/sys/i386/include/apicvar.h
index f917357..cada017 100644
--- a/sys/i386/include/apicvar.h
+++ b/sys/i386/include/apicvar.h
@@ -187,12 +187,6 @@
#define APIC_BUS_PCI 2
#define APIC_BUS_MAX APIC_BUS_PCI
-enum lapic_clock {
- LAPIC_CLOCK_NONE,
- LAPIC_CLOCK_HARDCLOCK,
- LAPIC_CLOCK_ALL
-};
-
/*
* An APIC enumerator is a psuedo bus driver that enumerates APIC's including
* CPU's and I/O APIC's.
@@ -263,7 +257,6 @@ int lapic_set_lvt_triggermode(u_int apic_id, u_int lvt,
enum intr_trigger trigger);
void lapic_set_tpr(u_int vector);
void lapic_setup(int boot);
-enum lapic_clock lapic_setup_clock(enum lapic_clock srcsdes);
#endif /* !LOCORE */
#endif /* _MACHINE_APICVAR_H_ */
OpenPOWER on IntegriCloud