summaryrefslogtreecommitdiff
path: root/drivers/auth
diff options
context:
space:
mode:
authorJohn Tsichritzis <john.tsichritzis@arm.com>2019-02-28 11:14:03 +0000
committerJohn Tsichritzis <john.tsichritzis@arm.com>2019-02-28 14:01:42 +0000
commit17e1335c893bce16883c8e76b251e1013c6ec001 (patch)
treeeb5d0fa7e45e0df8b5575882e1a1230bd2cf0592 /drivers/auth
parent64503b2f81bbd12051d8e0fd065a5a0b0c38bd2a (diff)
Remove Mbed TLS dependency from plat_bl_common.c
Due to the shared Mbed TLS heap optimisation introduced in 6d01a463, common code files were depending on Mbed TLS specific headers. This dependency is now removed by moving the default, unoptimised heap implementation inside the Mbed TLS specific files. Change-Id: I11ea3eb4474f0d9b6cb79a2afd73a51a4a9b8994 Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
Diffstat (limited to 'drivers/auth')
-rw-r--r--drivers/auth/mbedtls/mbedtls_common.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/auth/mbedtls/mbedtls_common.c b/drivers/auth/mbedtls/mbedtls_common.c
index b6d02fd1..cdb50429 100644
--- a/drivers/auth/mbedtls/mbedtls_common.c
+++ b/drivers/auth/mbedtls/mbedtls_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -16,6 +16,8 @@
#include <drivers/auth/mbedtls/mbedtls_config.h>
#include <plat/common/platform.h>
+#pragma weak plat_get_mbedtls_heap
+
static void cleanup(void)
{
ERROR("EXIT from BL2\n");
@@ -54,3 +56,19 @@ void mbedtls_init(void)
ready = 1;
}
}
+
+/*
+ * The following default implementation of the function simply returns the
+ * by default allocated heap.
+ */
+int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
+{
+ static unsigned char heap[TF_MBEDTLS_HEAP_SIZE];
+
+ assert(heap_addr != NULL);
+ assert(heap_size != NULL);
+
+ *heap_addr = heap;
+ *heap_size = sizeof(heap);
+ return 0;
+}