Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JOIFK-00084y-Ij for mharc-grub-devel@gnu.org; Sun, 10 Feb 2008 14:53:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOIFI-00082s-T0 for grub-devel@gnu.org; Sun, 10 Feb 2008 14:53:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOIFI-000825-Aa for grub-devel@gnu.org; Sun, 10 Feb 2008 14:53:48 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOIFI-00081o-3p for grub-devel@gnu.org; Sun, 10 Feb 2008 14:53:48 -0500 Received: from bigbox.boeglin.org ([88.191.20.48]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOIFH-0001XA-PE for grub-devel@gnu.org; Sun, 10 Feb 2008 14:53:48 -0500 Received: by bigbox.boeglin.org (Postfix, from userid 1000) id 919AC94097; Sun, 10 Feb 2008 20:54:08 +0100 (CET) Date: Sun, 10 Feb 2008 20:54:08 +0100 From: Alexandre Boeglin To: The development of GRUB 2 Message-ID: <20080210195408.GB1165@boeglin.org> References: <20071103230631.GA2875@boeglin.org> <87hcjuhzo8.fsf@xs4all.nl> <20071118181403.GA11941@boeglin.org> <20080123114331.GA27060@thorin> <20080205213929.GB21086@boeglin.org> <20080205221023.GA30724@thorin> <20080210163727.GA32575@boeglin.org> <20080210165612.GA12707@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20080210165612.GA12707@thorin> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Content-Transfer-Encoding: quoted-printable X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: Generic halt and reboot commands (was: Re: grub2 efi patches) 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: Sun, 10 Feb 2008 19:53:49 -0000 Le dim 10 f=E9v 2008 =E0 17:56:12 +0100, Robert Millan a =E9crit : > On Sun, Feb 10, 2008 at 05:37:27PM +0100, Alexandre Boeglin wrote: > >=20 > > * commands/halt.c: ... to here. > > Add some precompiler directive to include the correct header for ea= ch > > machine. >=20 > Can we simplify this? Since grub_halt() is put in kernel anyway, why n= ot > always export it from kernel.h ? Well, efi, for instance, is not machine dependant, and so the header is n= ot located in include/grub/i386/efi but in include/grub/efi > Also, could you provide the diff after you have issued > "mv commands/ieee1275/halt.c commands/halt.c" or so? That will make it= much > easier to read than comparing files by hand. Ok, here are the diffs. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --- grub2_commit/commands/ieee1275/halt.c 2007-07-22 01:32:19.00000= 0000 +0200 +++ grub2_clean/commands/halt.c 2008-02-10 17:07:47.847689750 +0100 @@ -19,8 +19,13 @@ =20 #include #include -#include +#include + +#ifdef GRUB_MACHINE_IEEE1275 #include +#elif defined GRUB_MACHINE_EFI +#include +#endif =20 static grub_err_t grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)), @@ -32,7 +37,7 @@ grub_cmd_halt (struct grub_arg_list *sta } =20 =20 -GRUB_MOD_INIT(ieee1275_halt) +GRUB_MOD_INIT(halt) { (void)mod; /* To stop warning. */ grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, @@ -40,7 +45,7 @@ GRUB_MOD_INIT(ieee1275_halt) " work on all firmware.", 0); } =20 -GRUB_MOD_FINI(ieee1275_halt) +GRUB_MOD_FINI(halt) { grub_unregister_command ("halt"); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --- grub2_commit/commands/ieee1275/reboot.c 2007-07-22 01:32:20.00000= 0000 +0200 +++ grub2_clean/commands/reboot.c 2008-02-10 17:04:14.486355500 +01= 00 @@ -19,8 +19,16 @@ =20 #include #include -#include +#include + +#ifdef GRUB_MACHINE_IEEE1275 #include +#elif defined GRUB_MACHINE_EFI +#include +#elif defined GRUB_MACHINE_PCBIOS +#include +#endif + =20 static grub_err_t grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), @@ -32,14 +40,14 @@ grub_cmd_reboot (struct grub_arg_list *s } =20 =20 -GRUB_MOD_INIT(ieee1275_reboot) +GRUB_MOD_INIT(reboot) { (void)mod; /* To stop warning. */ grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BO= TH, "reboot", "Reboot the computer", 0); } =20 -GRUB_MOD_FINI(ieee1275_reboot) +GRUB_MOD_FINI(reboot) { grub_unregister_command ("reboot"); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --- grub2_commit/commands/i386/pc/reboot.c 2007-07-22 01:32:19.00000= 0000 +0200 +++ grub2_clean/commands/reboot.c 2008-02-10 17:04:14.486355500 +01= 00 @@ -19,20 +19,26 @@ =20 #include #include -#include +#include + +#ifdef GRUB_MACHINE_IEEE1275 +#include +#elif defined GRUB_MACHINE_EFI +#include +#elif defined GRUB_MACHINE_PCBIOS #include +#endif + =20 static grub_err_t grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) - { grub_reboot (); return 0; } =20 - =20 GRUB_MOD_INIT(reboot) { =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D