summaryrefslogtreecommitdiffstats
path: root/tools/imagetool.h
diff options
context:
space:
mode:
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>2015-01-15 02:48:05 -0200
committerTom Rini <trini@ti.com>2015-01-29 13:38:41 -0500
commit0ca6691c2ec20ff264d882854c339795579991f5 (patch)
tree87dfba3b64f749fc0a0e3215b4ee7513ed3e42a2 /tools/imagetool.h
parent44f145fd81f73a5c5adc490b0da91b80a4c7790a (diff)
downloadblackbird-obmc-uboot-0ca6691c2ec20ff264d882854c339795579991f5.tar.gz
blackbird-obmc-uboot-0ca6691c2ec20ff264d882854c339795579991f5.zip
imagetool: move common code to imagetool module
The get_type() and verify_print_header() functions have the same code on both dumpimage.c and mkimage.c modules. Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Diffstat (limited to 'tools/imagetool.h')
-rw-r--r--tools/imagetool.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/imagetool.h b/tools/imagetool.h
index 8bce059482..eb2750cf69 100644
--- a/tools/imagetool.h
+++ b/tools/imagetool.h
@@ -150,6 +150,37 @@ void register_image_tool(imagetool_register_t image_register);
*/
void register_image_type(struct image_type_params *tparams);
+/**
+ * imagetool_get_type() - find the image type params for a given image type
+ *
+ * It scans all registers image type supports
+ * checks the input type for each supported image type
+ *
+ * if successful,
+ * returns respective image_type_params pointer if success
+ * if input type_id is not supported by any of image_type_support
+ * returns NULL
+ */
+struct image_type_params *imagetool_get_type(
+ int type,
+ struct image_type_params *tparams);
+
+/*
+ * imagetool_verify_print_header() - verifies the image header
+ *
+ * Scan registered image types and verify the image_header for each
+ * supported image type. If verification is successful, this prints
+ * the respective header.
+ *
+ * @return 0 on success, negative if input image format does not match with
+ * any of supported image types
+ */
+int imagetool_verify_print_header(
+ void *ptr,
+ struct stat *sbuf,
+ struct image_type_params *tparams,
+ struct image_tool_params *params);
+
/*
* There is a c file associated with supported image type low level code
* for ex. default_image.c, fit_image.c
OpenPOWER on IntegriCloud