summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-12-22 22:16:09 +0000
committerjhb <jhb@FreeBSD.org>2005-12-22 22:16:09 +0000
commitcb0d490ebe9e4d2fdb160451bfb076856c76f155 (patch)
tree5d9826b3ac47ed5cf683fc0866e2dc25566d6a56 /sys/ia64
parentfdec22285a69d07ca0d4320e306828b89e06a8dd (diff)
downloadFreeBSD-src-cb0d490ebe9e4d2fdb160451bfb076856c76f155.zip
FreeBSD-src-cb0d490ebe9e4d2fdb160451bfb076856c76f155.tar.gz
Tweak how the MD code calls the fooclock() methods some. Instead of
passing a pointer to an opaque clockframe structure and requiring the MD code to supply CLKF_FOO() macros to extract needed values out of the opaque structure, just pass the needed values directly. In practice this means passing the pair (usermode, pc) to hardclock() and profclock() and passing the boolean (usermode) to hardclock_cpu() and hardclock_process(). Other details: - Axe clockframe and CLKF_FOO() macros on all architectures. Basically, all the archs were taking a trapframe and converting it into a clockframe one way or another. Now they can just extract the PC and usermode values directly out of the trapframe and pass it to fooclock(). - Renamed hardclock_process() to hardclock_cpu() as the latter is more accurate. - On Alpha, we now run profclock() at hz (profhz == hz) rather than at the slower stathz. - On Alpha, for the TurboLaser machines that don't have an 8254 timecounter, call hardclock() directly. This removes an extra conditional check from every clock interrupt on Alpha on the BSP. There is probably room for even further pruning here by changing Alpha to use the simplified timecounter we use on x86 with the lapic timer since we don't get interrupts from the 8254 on Alpha anyway. - On x86, clkintr() shouldn't ever be called now unless using_lapic_timer is false, so add a KASSERT() to that affect and remove a condition to slightly optimize the non-lapic case. - Change prototypeof arm_handler_execute() so that it's first arg is a trapframe pointer rather than a void pointer for clarity. - Use KCOUNT macro in profclock() to lookup the kernel profiling bucket. Tested on: alpha, amd64, arm, i386, ia64, sparc64 Reviewed by: bde (mostly)
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/interrupt.c8
-rw-r--r--sys/ia64/include/cpu.h11
2 files changed, 4 insertions, 15 deletions
diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c
index 1a0c3d1..dbd3d68 100644
--- a/sys/ia64/ia64/interrupt.c
+++ b/sys/ia64/ia64/interrupt.c
@@ -173,12 +173,12 @@ interrupt(u_int64_t vector, struct trapframe *tf)
while (delta >= ia64_clock_reload) {
/* Only the BSP runs the real clock */
if (PCPU_GET(cpuid) == 0)
- hardclock((struct clockframe *)tf);
+ hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
else
- hardclock_process((struct clockframe *)tf);
+ hardclock_cpu(TRAPF_USERMODE(tf));
if (profprocs != 0)
- profclock((struct clockframe *)tf);
- statclock((struct clockframe *)tf);
+ profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
+ statclock(TRAPF_USERMODE(tf));
delta -= ia64_clock_reload;
clk += ia64_clock_reload;
if (adj != 0)
diff --git a/sys/ia64/include/cpu.h b/sys/ia64/include/cpu.h
index 424360a..982733d 100644
--- a/sys/ia64/include/cpu.h
+++ b/sys/ia64/include/cpu.h
@@ -44,17 +44,6 @@
#include <machine/frame.h>
-/*
- * Arguments to hardclock and gatherstats encapsulate the previous machine
- * state in an opaque clockframe.
- */
-struct clockframe {
- struct trapframe cf_tf;
-};
-#define CLKF_PC(cf) ((cf)->cf_tf.tf_special.iip)
-#define CLKF_CPL(cf) ((cf)->cf_tf.tf_special.psr & IA64_PSR_CPL)
-#define CLKF_USERMODE(cf) (CLKF_CPL(cf) != IA64_PSR_CPL_KERN)
-
#define TRAPF_PC(tf) ((tf)->tf_special.iip)
#define TRAPF_CPL(tf) ((tf)->tf_special.psr & IA64_PSR_CPL)
#define TRAPF_USERMODE(tf) (TRAPF_CPL(tf) != IA64_PSR_CPL_KERN)
OpenPOWER on IntegriCloud