summaryrefslogtreecommitdiff
path: root/cactus
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2017-11-22 13:56:18 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2017-11-23 09:22:52 +0000
commit9ab2c503c01b052b77fdc14fc9589b4b63378472 (patch)
tree50828c71833e7871593d36080f97adf707ee6a5c /cactus
parentbdfe99834260af0e3f929e1fd9e1b0691637e2e3 (diff)
Cactus: Cast the EL3/S-EL0 buffer pointer
Cactus receives from the ARM Trusted Firmware the address of a memory buffer containing some boot information. This patch casts this void* pointer into a pointer to secure_partition_boot_info_t to manipulate it easily. Change-Id: Ic59335fb89f11f3990b962f43b26cf8de6c5f0d6 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'cactus')
-rw-r--r--cactus/cactus_main.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/cactus/cactus_main.c b/cactus/cactus_main.c
index a67d1fe..0bec5aa 100644
--- a/cactus/cactus_main.c
+++ b/cactus/cactus_main.c
@@ -18,7 +18,14 @@
extern const char build_message[];
extern const char version_string[];
-static void cactus_print_memory_layout(secure_partition_boot_info_t *boot_info)
+/*
+ * The ARM Trusted Firmware passes a description of the memory resources
+ * allocated to the secure partition through the x0 register. This maps to
+ * a secure_partition_boot_info_t structure type.
+ *
+ * This functions prints the information stored in this structure.
+ */
+static void cactus_print_memory_layout(const secure_partition_boot_info_t *boot_info)
{
NOTICE("Secure Partition memory layout:\n");
NOTICE(" Secure Partition image : %p - %p\n",
@@ -63,11 +70,15 @@ int cactus_main(void *el3_el0_buffer, size_t el3_el0_buffer_size)
NOTICE("%s\n", version_string);
NOTICE("Running at S-EL0\n");
- cactus_print_memory_layout(el3_el0_buffer);
+ const secure_partition_boot_info_t *boot_info =
+ (const secure_partition_boot_info_t *) el3_el0_buffer;
+
+ cactus_print_memory_layout(boot_info);
+
misc_tests();
system_setup_tests();
- mem_attr_changes_tests((secure_partition_boot_info_t *)el3_el0_buffer);
+ mem_attr_changes_tests(boot_info);
return 0;
}