From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mh0oh-0000y5-4j for mharc-grub-devel@gnu.org; Fri, 28 Aug 2009 08:44:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mh0oc-0000wv-9T for grub-devel@gnu.org; Fri, 28 Aug 2009 08:44:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mh0oV-0000vU-Tl for grub-devel@gnu.org; Fri, 28 Aug 2009 08:44:24 -0400 Received: from [199.232.76.173] (port=43269 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh0oU-0000v4-S7 for grub-devel@gnu.org; Fri, 28 Aug 2009 08:44:19 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:38732 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mh0oU-0006P2-Ai for grub-devel@gnu.org; Fri, 28 Aug 2009 08:44:18 -0400 Received: from [192.168.10.10] (helo=localhost) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1Mh0oS-0002UX-6n for grub-devel@gnu.org; Fri, 28 Aug 2009 14:44:16 +0200 Received: from rmh by localhost with local (Exim 4.69) (envelope-from ) id 1Mh0oR-0003vc-M8 for grub-devel@gnu.org; Fri, 28 Aug 2009 14:44:15 +0200 Date: Fri, 28 Aug 2009 14:44:15 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090828124415.GB15030@thorin> References: <20090812221431.GD11691@riva.ucam.org> <20090824092406.GE11691@riva.ucam.org> <20090824122352.GB18956@thorin> <20090824220419.GA31998@riva.ucam.org> <20090824224120.GC25093@thorin> <20090824230217.GM11691@riva.ucam.org> <20090826153356.GA6830@riva.ucam.org> <20090826183900.GA21030@thorin> <20090826202606.GR11691@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090826202606.GR11691@riva.ucam.org> 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.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Detect key modifier status in 'sleep --interruptible' 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: Fri, 28 Aug 2009 12:44:27 -0000 On Wed, Aug 26, 2009 at 09:26:06PM +0100, Colin Watson wrote: > > > > I'm still not convinced that we want the sleep bits. They seem too ad-hoc, > > and I'd like to hear what others think first. > > > > But if I understood correctly, you plan on using keystatus command only? > > If GRUB_HIDDEN_TIMEOUT is set to a non-zero value, I would use sleep > rather than keystatus, I think. (At least, if I decided I wanted to > support that configuration; I'm not quite sure yet.) In that case I'd > want the sleep to be interruptible by pressing Shift for consistency > with the zero-delay case. > > However, since this is essentially an artifact of our configuration and > doesn't introduce any new configuration file words, I could keep this > part as an Ubuntu-specific patch with relatively little trouble. Please do for now. I'd rather not rush when discussing this part. > > > +static int > > > +grub_console_getkeystatus (void) > > > +{ > > > + grub_uint8_t status = bios_data_area->keyboard_flag_lower; > > > + int mods = 0; > > > + > > > + if (status & 0x03) > > > + mods |= GRUB_TERM_STATUS_SHIFT; > > > + if (status & 0x04) > > > + mods |= GRUB_TERM_STATUS_CTRL; > > > + if (status & 0x08) > > > + mods |= GRUB_TERM_STATUS_ALT; > > > + > > > + return mods; > > > +} > > > > This should be macroified (but for the time being, I have no problem with > > our internal representation matching the one in BIOS Data Area, hence no > > translation would be needed on i386-pc). > > Vladimir objected to the inconsistency between distinguishing left and > right Shift but not left and right Control or Alt, which is why our > internal representation does not currently match. I agree it's clearer > to macroify things. Looks fine now, thanks. > OK, and doing so helped me notice that I'd left a Get_Idle request in > there by mistake from debugging. Updated patch follows. There are a few > changes unrelated to the main body of the patch as a result; do you want > these split out? No need, this looks good. Please commit. -- 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."