From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QesAK-0007LS-Kg for qemu-devel@nongnu.org; Thu, 07 Jul 2011 13:15:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QesAI-0004sP-Rn for qemu-devel@nongnu.org; Thu, 07 Jul 2011 13:15:04 -0400 Received: from mtxmxout5.matrox.com ([138.11.2.95]:49671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QesAI-0004sJ-By for qemu-devel@nongnu.org; Thu, 07 Jul 2011 13:15:02 -0400 Date: Thu, 7 Jul 2011 13:15:00 -0400 From: Christopher Harvey Message-ID: <20110707171500.GF5438@harvey-pc.matrox.com> References: <20110706200435.GA2168@harvey-pc.matrox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] Implement the global timer present in ARM MPCore chips. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Wed, Jul 06, 2011 at 10:58:09PM +0100, Peter Maydell wrote: > On 6 July 2011 21:04, Christopher Harvey wrote: > > Below are some random comments noticed on a first-pass. > > > +/* Global timer data */ > > +static uint64_t global_timer_count = 0; > > +static uint64_t global_timer_this_inc = 0; > > + ??/* Only for prescale and enable bits */ > > +static uint32_t global_timer_control = 0; > > Static globals look like the wrong thing to me. > My C code design is pretty bad. I generally just try to copy the style around what I'm editing. These variables are to be used exclusively inside hw/mpcore.c and are referenced in many of the functions. How would you change this code? thanks, -Chris