From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDykD-0007O2-1p for qemu-devel@nongnu.org; Tue, 09 Jun 2009 06:39:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDyk6-0007Mg-02 for qemu-devel@nongnu.org; Tue, 09 Jun 2009 06:39:50 -0400 Received: from [199.232.76.173] (port=39840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDyk5-0007MW-7c for qemu-devel@nongnu.org; Tue, 09 Jun 2009 06:39:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37402) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDyk4-0006y2-Q0 for qemu-devel@nongnu.org; Tue, 09 Jun 2009 06:39:45 -0400 Date: Tue, 9 Jun 2009 13:39:41 +0300 From: Gleb Natapov Message-ID: <20090609103941.GV27210@redhat.com> References: <20090609092605.GU27210@redhat.com> <4A2E3819.8050509@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A2E3819.8050509@siemens.com> Subject: [Qemu-devel] Re: [PATCHv2] Add rtc reset function. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Tue, Jun 09, 2009 at 12:23:21PM +0200, Jan Kiszka wrote: > > +static void rtc_reset(void *opaque) > > +{ > > + RTCState *s = opaque; > > + > > + s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE); > > + s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF); > > + > > + qemu_irq_lower(s->irq); > > + > > +#ifdef TARGET_I386 > > + if (rtc_td_hack) > > + s->irq_coalesced = 0; > > Sorry, missed that on first run: Isn't it safer, clearer, more beautiful > to reset this unconditionally? > It doesn't really matter. From safety point of view the code is safe. -- Gleb.