Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LvSl3-00058q-6S for mharc-grub-devel@gnu.org; Sun, 19 Apr 2009 04:52:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvSl1-00058R-5B for grub-devel@gnu.org; Sun, 19 Apr 2009 04:52:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvSl0-00058D-Gh for grub-devel@gnu.org; Sun, 19 Apr 2009 04:52:10 -0400 Received: from [199.232.76.173] (port=39291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvSl0-000589-Bx for grub-devel@gnu.org; Sun, 19 Apr 2009 04:52:10 -0400 Received: from [74.93.104.97] (port=44903 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LvSkz-00041X-RA for grub-devel@gnu.org; Sun, 19 Apr 2009 04:52:10 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id DF50D35C12C for ; Sun, 19 Apr 2009 01:51:57 -0700 (PDT) Date: Sun, 19 Apr 2009 01:51:57 -0700 (PDT) Message-Id: <20090419.015157.47061650.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: Fix sparc64 linux loader command registry. 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, 19 Apr 2009 08:52:11 -0000 This code needed to be updated to deal with the fact that the whole rescue thing is not being used any more. Committed. 2009-04-19 David S. Miller * loader/sparc64/ieee1275/linux.c: Include grub/command.h (grub_rescue_cmd_linux): Rename to... (grub_cmd_linux): and fix prototype. (grub_rescue_cmd_initrd): Rename to... (grub_cmd_initrd): and fix prototype. (cmd_linux, cmd_initrd): New. (GRUB_MOD_INIT(linux)): Use grub_register_command(). (GRUB_MOD_FINI(linux): Use grub_unregister_command(). diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index 4912b97..4f5b3ce 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -27,6 +27,7 @@ #include #include #include +#include static grub_dl_t my_mod; @@ -281,8 +282,9 @@ grub_linux_load64 (grub_elf_t elf) return grub_elf64_load (elf, offset_phdr, 0, 0); } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_elf_t elf = 0; @@ -360,10 +362,13 @@ out: initrd_addr = 0; loaded = 1; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -421,6 +426,8 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } static void @@ -495,20 +502,22 @@ fetch_translations (void) } +static grub_command_t cmd_linux, cmd_initrd; + GRUB_MOD_INIT(linux) { determine_phys_base (); fetch_translations (); - grub_rescue_register_command ("linux", grub_rescue_cmd_linux, - "load a linux kernel"); - grub_rescue_register_command ("initrd", grub_rescue_cmd_initrd, - "load an initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load a linux kernel"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load an initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); }