From owner-p4-projects@FreeBSD.ORG Tue Jul 17 14:51:24 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 46EEB16A401; Tue, 17 Jul 2007 14:51:24 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E100516A406 for ; Tue, 17 Jul 2007 14:51:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D19ED13C4CA for ; Tue, 17 Jul 2007 14:51:23 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6HEpNfe020898 for ; Tue, 17 Jul 2007 14:51:23 GMT (envelope-from attilio@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6HEpNhW020895 for perforce@freebsd.org; Tue, 17 Jul 2007 14:51:23 GMT (envelope-from attilio@FreeBSD.org) Date: Tue, 17 Jul 2007 14:51:23 GMT Message-Id: <200707171451.l6HEpNhW020895@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to attilio@FreeBSD.org using -f From: Attilio Rao To: Perforce Change Reviews Cc: Subject: PERFORCE change 123655 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2007 14:51:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=123655 Change 123655 by attilio@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@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;