summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-01-26 11:42:01 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-02-02 00:19:08 +0900
commit2e379d2f1b9e63492ed80a352dbbae7acb4e3a20 (patch)
tree0258cccae9e5bb47d43c33998cf1bbd7c4215300 /include
parent11f001cb7f26e9c50e688038ebdc9627ea5c4300 (diff)
image_decompress: add APIs for decompressing images
These APIs are used by platforms that need to decompress images. image_decompress_init(): This registers a temporary buffer and a decompressor callback. This should be called from platform init code. image_decompress_prepare(): This should be called before each compressed image is loaded. The best location to call this will be bl*_plat_handle_pre_image_load(). image_decompress(): This should be called after each compressed image is loaded. The best location to call this will be bl*_plat_handle_post_image_load(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'include')
-rw-r--r--include/common/image_decompress.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/common/image_decompress.h b/include/common/image_decompress.h
new file mode 100644
index 00000000..aed8df30
--- /dev/null
+++ b/include/common/image_decompress.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef __IMAGE_DECOMPRESS_H__
+#define __IMAGE_DECOMPRESS_H__
+
+#include <stddef.h>
+#include <stdint.h>
+
+struct image_info;
+
+typedef int (decompressor_t)(uintptr_t *in_buf, size_t in_len,
+ uintptr_t *out_buf, size_t out_len,
+ uintptr_t work_buf, size_t work_len);
+
+void image_decompress_init(uintptr_t buf_base, uint32_t buf_size,
+ decompressor_t *decompressor);
+void image_decompress_prepare(struct image_info *info);
+int image_decompress(struct image_info *info);
+
+#endif /* __IMAGE_DECOMPRESS_H___ */