From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KSrR6-0000fb-L5 for mharc-grub-devel@gnu.org; Tue, 12 Aug 2008 06:49:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSrR1-0000eK-TD for grub-devel@gnu.org; Tue, 12 Aug 2008 06:49:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSrQz-0000cx-R9 for grub-devel@gnu.org; Tue, 12 Aug 2008 06:49:02 -0400 Received: from [199.232.76.173] (port=55330 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSrQy-0000cm-Ej for grub-devel@gnu.org; Tue, 12 Aug 2008 06:49:01 -0400 Received: from aybabtu.com ([69.60.117.155]:53741) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSrQy-00013T-3w for grub-devel@gnu.org; Tue, 12 Aug 2008 06:49:00 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KSrIy-0001MN-Fk for grub-devel@gnu.org; Tue, 12 Aug 2008 12:40:45 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1KSrPo-00013x-3H for grub-devel@gnu.org; Tue, 12 Aug 2008 12:47:48 +0200 Date: Tue, 12 Aug 2008 12:47:48 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080812104748.GB3930@thorin> References: <20080812030708.GB16592@spacedout.fries.net> <20080812091037.GC381@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080812091037.GC381@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Enable grub_cpu_idle for i386 to halt the CPU X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 10:49:06 -0000 On Tue, Aug 12, 2008 at 11:10:37AM +0200, Robert Millan wrote: > > +void > > +grub_cpu_idle () > > +{ > > + struct timespec req={0,1}; > > + nanosleep (&req, NULL); > > +} > > grub_cpu_idle is intended to be a (cpu-independant) primitive, not a stub for > nanosleep. Ah, sorry. I notice you're writing user code here. This would be best kept as an inline in the same file that defines grub_cpu_idle for real GRUB, something like: #ifdef GRUB_UTIL use nanosleep #else use hlt #endif In include/grub/i386/time.h. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."