Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2002 17:55:50 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 16621 for review
Message-ID:  <200208270055.g7R0to80059950@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16621

Change 16621 by peter@peter_mckinley on 2002/08/26 17:55:15

	slight optimization.  Precalculate the reload amount once, since we do
	not have integer divide.

Affected files ...

.. //depot/projects/ia64/sys/ia64/ia64/clock.c#8 edit
.. //depot/projects/ia64/sys/ia64/ia64/interrupt.c#13 edit
.. //depot/projects/ia64/sys/ia64/ia64/mp_machdep.c#20 edit
.. //depot/projects/ia64/sys/ia64/include/clock.h#3 edit

Differences ...

==== //depot/projects/ia64/sys/ia64/ia64/clock.c#8 (text+ko) ====

@@ -78,10 +78,9 @@
 int	adjkerntz;		/* local offset	from GMT in seconds */
 int	disable_rtc_set;	/* disable resettodr() if != 0 */
 int	wall_cmos_clock;	/* wall	CMOS clock assumed if != 0 */
+u_int64_t itm_reload;		/* reload ticks for clock */
 static	int	beeping = 0;
 
-extern u_int64_t itc_frequency;
-
 #ifndef SMP
 static timecounter_get_t	ia64_get_timecount;
 
@@ -192,7 +191,8 @@
 	tc_init(&ia64_timecounter);
 #endif
 
-	ia64_set_itm(ia64_get_itc() + (itc_frequency + hz/2) / hz);
+	itm_reload = (itc_frequency + hz/2) / hz;
+	ia64_set_itm(ia64_get_itc() + itm_reload);
 	ia64_set_itv(255);	/* highest priority class */
 
 	stathz = 128;

==== //depot/projects/ia64/sys/ia64/ia64/interrupt.c#13 (text+ko) ====

@@ -87,7 +87,6 @@
 
 
 static u_int schedclk2;
-extern u_int64_t itc_frequency;
 
 void
 interrupt(u_int64_t vector, struct trapframe *framep)
@@ -128,7 +127,7 @@
 				statclock((struct clockframe *)framep);
 #ifdef SMP
 		} else {
-			ia64_set_itm(ia64_get_itc() + (itc_frequency + hz/2) / hz);
+			ia64_set_itm(ia64_get_itc() + itm_reload);
 			mtx_lock_spin(&sched_lock);
 			hardclock_process(curthread, TRAPF_USERMODE(framep));
 			if ((schedclk2 & 0x7) == 0)

==== //depot/projects/ia64/sys/ia64/ia64/mp_machdep.c#20 (text+ko) ====

@@ -58,7 +58,6 @@
 
 void ia64_ap_startup(void);
 
-extern u_int64_t itc_frequency;
 extern vm_offset_t vhpt_base, vhpt_size;
 
 #define	LID_SAPIC_ID(x)		((int)((x) >> 24) & 0xff)
@@ -119,7 +118,7 @@
 	mtx_lock_spin(&sched_lock);
 
 	/* kick off the clock on this AP */
-	ia64_set_itm(ia64_get_itc() + (itc_frequency + hz/2) / hz);
+	ia64_set_itm(ia64_get_itc() + itm_reload);
 	ia64_set_itv(255);
 	cpu_throw();
 	panic("ia64_ap_startup: cpu_throw() returned");

==== //depot/projects/ia64/sys/ia64/include/clock.h#3 (text+ko) ====

@@ -15,6 +15,9 @@
 extern	int	wall_cmos_clock;
 extern	int	adjkerntz;
 
+extern	u_int64_t	itc_frequency;
+extern	u_int64_t	itm_reload;
+
 int	sysbeep(int pitch, int period);
 int	acquire_timer2(int mode);
 int	release_timer2(void);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208270055.g7R0to80059950>