[2128] * loader/sparc64/ieee1275/linux.c: Include grub/command.h

"David S. Miller" <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2128
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2128
Author:   davem
Date:     2009-04-19 08:51:04 +0000 (Sun, 19 Apr 2009)
Log Message:
-----------
	* 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().

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/loader/sparc64/ieee1275/linux.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-04-17 17:23:34 UTC (rev 2127)
+++ trunk/grub2/ChangeLog	2009-04-19 08:51:04 UTC (rev 2128)
@@ -1,3 +1,14 @@
+2009-04-19  David S. Miller  <[email protected]>
+
+	* 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().
+
 2009-04-17  Pavel Roskin  <[email protected]>
 
 	* bus/usb/ohci.c (grub_ohci_transaction): Fix incorrect printf

Modified: trunk/grub2/loader/sparc64/ieee1275/linux.c
===================================================================
--- trunk/grub2/loader/sparc64/ieee1275/linux.c	2009-04-17 17:23:34 UTC (rev 2127)
+++ trunk/grub2/loader/sparc64/ieee1275/linux.c	2009-04-19 08:51:04 UTC (rev 2128)
@@ -27,6 +27,7 @@
 #include <grub/ieee1275/ieee1275.h>
 #include <grub/machine/loader.h>
 #include <grub/gzio.h>
+#include <grub/command.h>
 
 static grub_dl_t my_mod;
 
@@ -281,8 +282,9 @@
   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 @@
       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 @@
  fail:
   if (file)
     grub_file_close (file);
+
+  return grub_errno;
 }
 
 static void
@@ -495,20 +502,22 @@
 }
 
 
+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);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.