PERFORCE change 123655 for review
Attilio Rao
attilio at FreeBSD.org
Tue Jul 17 14:51:24 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=123655
Change 123655 by attilio at attilio_xen on 2007/07/17 14:50:39
More cleanups on macros/static variables
Affected files ...
.. //depot/projects/xen3/src/sys/i386-xen/i386-xen/clock.c#18 edit
Differences ...
==== //depot/projects/xen3/src/sys/i386-xen/i386-xen/clock.c#18 (text+ko) ====
@@ -98,6 +98,11 @@
#define TIMER_FREQ 1193182
#endif
+#ifdef CYC2NS_SCALE_FACTOR
+#undef CYC2NS_SCALE_FACTOR
+#endif
+#define CYC2NS_SCALE_FACTOR 10
+
/* Values for timerX_state: */
#define RELEASED 0
#define RELEASE_PENDING 1
@@ -118,9 +123,11 @@
static int independent_wallclock;
static int xen_disable_rtc_set;
static u_long cached_gtm; /* cached quotient for TSC -> microseconds */
+static u_long cyc2ns_scale;
static u_char timer2_state = RELEASED;
static struct timespec shadow_tv;
static uint32_t shadow_tv_version; /* XXX: lazy locking */
+static uint64_t processed_system_time; /* stime (ns) at last processing. */
static struct mtx clock_lock;
static const u_char daysinmonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
@@ -155,7 +162,6 @@
int tsc_shift;
uint32_t version;
};
-static uint64_t processed_system_time;/* System time (ns) at last processing. */
static DEFINE_PER_CPU(uint64_t, processed_system_time);
static DEFINE_PER_CPU(struct shadow_time_info, shadow_time);
@@ -181,9 +187,6 @@
* into a shift.
* -johnstul at us.ibm.com "math is hard, lets go shopping!"
*/
-static unsigned long cyc2ns_scale;
-#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
-
static inline void set_cyc2ns_scale(unsigned long cpu_mhz)
{
cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
More information about the p4-projects
mailing list