summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2018-02-06 05:12:28 +0000
committerGitHub <noreply@github.com>2018-02-06 05:12:28 +0000
commit9fd2f13bd608832260300640970f73c62357c684 (patch)
tree149d13158075ab08cccff2710ee8bedd0406d2c1 /include
parent10787b0519afce1e887a935789b2d624849856a9 (diff)
parent8951b058fce077dab7afcd86c532ec0fc0200352 (diff)
Merge pull request #1224 from masahir0y/gzip
Support GZIP-compressed images for faster loading and verification
Diffstat (limited to 'include')
-rw-r--r--include/common/image_decompress.h24
-rw-r--r--include/lib/zlib/tf_gunzip.h16
-rw-r--r--include/plat/common/platform.h12
3 files changed, 51 insertions, 1 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___ */
diff --git a/include/lib/zlib/tf_gunzip.h b/include/lib/zlib/tf_gunzip.h
new file mode 100644
index 00000000..46d20eb8
--- /dev/null
+++ b/include/lib/zlib/tf_gunzip.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef __TF_GUNZIP_H__
+#define __TF_GUNZIP_H__
+
+#include <stddef.h>
+#include <stdint.h>
+
+int gunzip(uintptr_t *in_buf, size_t in_len, uintptr_t *out_buf,
+ size_t out_len, uintptr_t work_buf, size_t work_len);
+
+#endif /* __TF_GUNZIP_H___ */
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index 09601058..e2f1cfdc 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -155,6 +155,15 @@ struct image_desc *bl1_plat_get_image_desc(unsigned int image_id);
*/
__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved);
+#if LOAD_IMAGE_V2
+/*
+ * This function can be used by the platforms to update/use image
+ * information for BL2.
+ */
+int bl1_plat_handle_pre_image_load(void);
+int bl1_plat_handle_post_image_load(void);
+
+#endif /* LOAD_IMAGE_V2 */
/*******************************************************************************
* Mandatory BL2 functions
@@ -169,6 +178,7 @@ struct meminfo *bl2_plat_sec_mem_layout(void);
* This function can be used by the platforms to update/use image
* information for given `image_id`.
*/
+int bl2_plat_handle_pre_image_load(unsigned int image_id);
int bl2_plat_handle_post_image_load(unsigned int image_id);
#else /* LOAD_IMAGE_V2 */