summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-02-03 17:53:15 +0000
committerjake <jake@FreeBSD.org>2003-02-03 17:53:15 +0000
commit6b3763a173b458d3138f8a5ae81d7574349cc99d (patch)
tree4ac2b707510b8d738855f9fa4a6576e6ded49a77 /sys/i386/include
parent9689f0580db3e8ffcfba46b99c0b3a370eb9524c (diff)
downloadFreeBSD-src-6b3763a173b458d3138f8a5ae81d7574349cc99d.zip
FreeBSD-src-6b3763a173b458d3138f8a5ae81d7574349cc99d.tar.gz
Split statclock into statclock and profclock, and made the method for driving
statclock based on profhz when profiling is enabled MD, since most platforms don't use this anyway. This removes the need for statclock_process, whose only purpose was to subdivide profhz, and gets the profiling clock running outside of sched_lock on platforms that implement suswintr. Also changed the interface for starting and stopping the profiling clock to do just that, instead of changing the rate of statclock, since they can now be separate. Reviewed by: jhb, tmm Tested on: i386, sparc64
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/clock.h2
-rw-r--r--sys/i386/include/mptable.h19
-rw-r--r--sys/i386/include/smp.h4
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h
index f6ed717..140a345 100644
--- a/sys/i386/include/clock.h
+++ b/sys/i386/include/clock.h
@@ -16,6 +16,8 @@
*/
extern int adjkerntz;
extern int disable_rtc_set;
+extern int pscnt;
+extern int psdiv;
extern int statclock_disable;
extern u_int timer_freq;
extern int timer0_max_count;
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 39d10d6..7960c51 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -63,6 +63,7 @@
#include <machine/apic.h>
#include <machine/atomic.h>
+#include <machine/clock.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/mpapic.h>
@@ -2603,17 +2604,17 @@ ap_init(void)
* For statclock, we send an IPI to all CPU's to have them call this
* function.
*
- * WARNING! unpend() will call statclock_process() directly and skip this
+ * WARNING! unpend() will call statclock() directly and skip this
* routine.
*/
void
-forwarded_statclock(struct trapframe frame)
+forwarded_statclock(struct clockframe frame)
{
- mtx_lock_spin(&sched_lock);
- statclock_process(curthread->td_kse, TRAPF_PC(&frame),
- TRAPF_USERMODE(&frame));
- mtx_unlock_spin(&sched_lock);
+ if (profprocs != 0)
+ profclock(&frame);
+ if (pscnt == psdiv)
+ statclock(&frame);
}
void
@@ -2642,12 +2643,10 @@ forward_statclock(void)
* routine.
*/
void
-forwarded_hardclock(struct trapframe frame)
+forwarded_hardclock(struct clockframe frame)
{
- mtx_lock_spin(&sched_lock);
- hardclock_process(curthread, TRAPF_USERMODE(&frame));
- mtx_unlock_spin(&sched_lock);
+ hardclock_process(&frame);
}
void
diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h
index f2250ff..2f576a2 100644
--- a/sys/i386/include/smp.h
+++ b/sys/i386/include/smp.h
@@ -113,9 +113,9 @@ void revoke_apic_irq(int irq);
void bsp_apic_configure(void);
void init_secondary(void);
void forward_statclock(void);
-void forwarded_statclock(struct trapframe frame);
+void forwarded_statclock(struct clockframe frame);
void forward_hardclock(void);
-void forwarded_hardclock(struct trapframe frame);
+void forwarded_hardclock(struct clockframe frame);
void ipi_selected(u_int cpus, u_int ipi);
void ipi_all(u_int ipi);
void ipi_all_but_self(u_int ipi);
OpenPOWER on IntegriCloud