summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMichael Brown2011-03-07 01:37:50 +0100
committerMichael Brown2011-03-07 01:37:50 +0100
commit34b6ecb2f1d7940a0065cbabd6f9dcd439b4c841 (patch)
treeea583bf6fde26b2ed12ee3c6b117055e555555d9 /src/include/usr
parent[spi] Reset device on each access (diff)
downloadipxe-34b6ecb2f1d7940a0065cbabd6f9dcd439b4c841.tar.gz
ipxe-34b6ecb2f1d7940a0065cbabd6f9dcd439b4c841.tar.xz
ipxe-34b6ecb2f1d7940a0065cbabd6f9dcd439b4c841.zip
[image] Simplify image management
Refactor the {load,exec} image operations as {probe,exec}. This makes the probe mechanism cleaner, eliminates some forward declarations, avoids holding magic state in image->priv, eliminates the possibility of screwing up between the "load" and "exec" stages, and makes the documentation simpler since the concept of "loading" (as distinct from "executing") no longer needs to be explained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/imgmgmt.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/include/usr/imgmgmt.h b/src/include/usr/imgmgmt.h
index 64e51499..6660039c 100644
--- a/src/include/usr/imgmgmt.h
+++ b/src/include/usr/imgmgmt.h
@@ -9,16 +9,42 @@
FILE_LICENCE ( GPL2_OR_LATER );
-struct image;
+#include <ipxe/image.h>
extern int imgdownload ( struct image *image, struct uri *uri,
int ( * action ) ( struct image *image ) );
extern int imgfetch ( struct image *image, const char *uri_string,
int ( * action ) ( struct image *image ) );
-extern int imgload ( struct image *image );
-extern int imgexec ( struct image *image );
-extern struct image * imgautoselect ( void );
extern void imgstat ( struct image *image );
extern void imgfree ( struct image *image );
+/**
+ * Select an image for execution
+ *
+ * @v image Image
+ * @ret rc Return status code
+ */
+static inline int imgselect ( struct image *image ) {
+ return image_select ( image );
+}
+
+/**
+ * Find the previously-selected image
+ *
+ * @ret image Image, or NULL
+ */
+static inline struct image * imgautoselect ( void ) {
+ return image_find_selected();
+}
+
+/**
+ * Execute an image
+ *
+ * @v image Image
+ * @ret rc Return status code
+ */
+static inline int imgexec ( struct image *image ) {
+ return image_exec ( image );
+}
+
#endif /* _USR_IMGMGMT_H */