]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[image] Move the register_and_{select|boot}_image() functions to imgmgmt.c
authorMichael Brown <mcb30@ipxe.org>
Wed, 9 Mar 2011 13:11:35 +0000 (13:11 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 9 Mar 2011 13:11:35 +0000 (13:11 +0000)
These functions are used only as the "action" parameters to
imgdownload() or imgfetch(), and so belong in imgmgmt.c rather than
image.c

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/image.c
src/include/ipxe/image.h
src/include/usr/imgmgmt.h
src/usr/imgmgmt.c

index 6caa0243480097cef1de2baf56e1fe8d586d3083..afb647d23b1a6de82b56c8024849f9d916be6856 100644 (file)
@@ -286,42 +286,3 @@ struct image * image_find_selected ( void ) {
        }
        return NULL;
 }
-
-/**
- * Register and select an image
- *
- * @v image            Executable image
- * @ret rc             Return status code
- */
-int register_and_select_image ( struct image *image ) {
-       int rc;
-
-       if ( ( rc = register_image ( image ) ) != 0 )
-               return rc;
-
-       if ( ( rc = image_probe ( image ) ) != 0 )
-               return rc;
-
-       if ( ( rc = image_select ( image ) ) != 0 )
-               return rc;
-
-       return 0;
-}
-
-/**
- * Register and boot an image
- *
- * @v image            Image
- * @ret rc             Return status code
- */
-int register_and_boot_image ( struct image *image ) {
-       int rc;
-
-       if ( ( rc = register_and_select_image ( image ) ) != 0 )
-               return rc;
-
-       if ( ( rc = image_exec ( image ) ) != 0 )
-               return rc;
-
-       return 0;
-}
index 96466ee40d857cf48bcb4fcb73046ee45f5d8324..539f8ca3981b08117fce54f3c82a1de9a0bb5c13 100644 (file)
@@ -143,8 +143,6 @@ extern int image_probe ( struct image *image );
 extern int image_exec ( struct image *image );
 extern int image_select ( struct image *image );
 extern struct image * image_find_selected ( void );
-extern int register_and_select_image ( struct image *image );
-extern int register_and_boot_image ( struct image *image );
 
 /**
  * Increment reference count on an image
index 6660039c4a56cc0933b73f3392474aeb6c7debc2..4299937fdc511059a52c811e1b32a9b1202a3750 100644 (file)
@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 #include <ipxe/image.h>
 
+extern int register_and_select_image ( struct image *image );
+extern int register_and_boot_image ( struct image *image );
 extern int imgdownload ( struct image *image, struct uri *uri,
                         int ( * action ) ( struct image *image ) );
 extern int imgfetch ( struct image *image, const char *uri_string,
index 6eefdfa5fc1a72699de66dbdfc2b66a8739769fa..f375db868811f5cd4987ff2574c435e00e76a0c0 100644 (file)
@@ -35,6 +35,45 @@ FILE_LICENCE ( GPL2_OR_LATER );
  *
  */
 
+/**
+ * Register and select an image
+ *
+ * @v image            Executable image
+ * @ret rc             Return status code
+ */
+int register_and_select_image ( struct image *image ) {
+       int rc;
+
+       if ( ( rc = register_image ( image ) ) != 0 )
+               return rc;
+
+       if ( ( rc = image_probe ( image ) ) != 0 )
+               return rc;
+
+       if ( ( rc = image_select ( image ) ) != 0 )
+               return rc;
+
+       return 0;
+}
+
+/**
+ * Register and boot an image
+ *
+ * @v image            Image
+ * @ret rc             Return status code
+ */
+int register_and_boot_image ( struct image *image ) {
+       int rc;
+
+       if ( ( rc = register_and_select_image ( image ) ) != 0 )
+               return rc;
+
+       if ( ( rc = image_exec ( image ) ) != 0 )
+               return rc;
+
+       return 0;
+}
+
 /**
  * Download an image
  *