From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N4B2F-0006LY-7U for mharc-grub-devel@gnu.org; Sat, 31 Oct 2009 06:18:15 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4B2D-0006KW-9f for grub-devel@gnu.org; Sat, 31 Oct 2009 06:18:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4B28-0006Gs-6P for grub-devel@gnu.org; Sat, 31 Oct 2009 06:18:12 -0400 Received: from [199.232.76.173] (port=42108 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4B27-0006Gm-WD for grub-devel@gnu.org; Sat, 31 Oct 2009 06:18:08 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:36761) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4B27-0003Zc-K2 for grub-devel@gnu.org; Sat, 31 Oct 2009 06:18:07 -0400 Received: by ewy7 with SMTP id 7so1601015ewy.31 for ; Sat, 31 Oct 2009 03:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=0/ftS4TvbZrDSPd4BzYpyAPRBbonvEcF69ylzwRMBGI=; b=MCXWrBp4axoAES9JlaLWD5kNHqJ9I6NLCAaLho1HD12RmkhFEcNof+qcetY6pf4GkS Feg8pdaKMsvooa6QypGCqiMj2GYZZ+1ceBvWdX/dmWMVYAkcU1QEYzxDL9hYvxHbcG7Y NZEB5zfRH506BXiquaF0HoFBayAt+lU1hsE6w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=b0QnhK8GnNj+c7PaLce4cRr2xrczqevJBzaOrZTjwZh09nFAZc3PIjcbQGgY3Um0Px 9yaaybH5srtS716wlaFmO6B76JcaMEmDdgPkEOKt2ZGlfgn/c+qID2SLMHICTqM1zmOi b+AtdEkXJUxYlfMyVhM6/iTzGPrvSGthfKcOQ= Received: by 10.216.93.81 with SMTP id k59mr1505907wef.169.1256984284398; Sat, 31 Oct 2009 03:18:04 -0700 (PDT) Received: from debian.bg45.phnet (eduroam127076.aire.ucm.es [147.96.127.76]) by mx.google.com with ESMTPS id 7sm10733628eyg.25.2009.10.31.03.18.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 Oct 2009 03:18:04 -0700 (PDT) Message-ID: <4AEC0EDB.4030901@gmail.com> Date: Sat, 31 Oct 2009 11:18:03 +0100 From: Vladimir 'phcoder' Serbinenko User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: The development of GRUB 2 References: <20091026181010.GA22942@thorin> <4AEB7207.9060009@gmail.com> <20091031100626.GA12730@thorin> In-Reply-To: <20091031100626.GA12730@thorin> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] turn grub-emu into a port 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: Sat, 31 Oct 2009 10:18:13 -0000 Robert Millan wrote: > On Sat, Oct 31, 2009 at 12:08:55AM +0100, Vladimir 'phcoder' Serbinenko wrote: > >> Robert Millan wrote: >> >>> This turns grub-emu into a port in order to make it easier to port GRUB to >>> new CPUs. A porter can then do the CPU port without having to worry about >>> firmware and/or hardware drivers initially. >>> >>> Patch attached. Branch is available in >>> bzr+ssh://bzr.savannah.gnu.org/grub/people/robertmh/grub-emu/ >>> >>> >>> >> Following hunk is a regression for me: >> - return (tv.tv_sec * GRUB_TICKS_PER_SECOND >> - + (((tv.tv_sec % GRUB_TICKS_PER_SECOND) * 1000000 + tv.tv_usec) >> - * GRUB_TICKS_PER_SECOND / 1000000)); >> + GRUB_COMPILE_TIME_ASSERT (GRUB_TICKS_PER_SECOND == 1000000); >> + return (tv.tv_sec * 1000000 + tv.tv_usec); >> Having virtual clock going at any rate is an advantage for debugging. >> > > I don't get what you mean. When GRUB runs on a Unix system, a tick > represents a 1000000th fraction of a second, and therefore > GRUB_TICKS_PER_SECOND is 1000000. > > The old behaviour tried to emulate the behaviour of the specific hardware > platform, but with grub-emu being a standalone port this doesn't make sense. > > I don't think we can have both things (old tick behaviour + portable grub-emu). > Was that behaviour useful? It seems to me that GRUB routines don't directly > care about number of ticker per second, but rather just use it as a means to > archieve something else. E.g. to compare output of grub_get_rtc(). > > I meant: keep GRUB_TICKS_PER_SECOND=1000000 per default but allow easy adjustment to any number by coder -- Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git