diff options
author | Paul Beesley <paul.beesley@arm.com> | 2019-10-15 10:57:42 +0000 |
---|---|---|
committer | Manish Pandey <manish.pandey2@arm.com> | 2019-12-20 16:03:41 +0000 |
commit | aeaa225cbe24d63539261210e5aa901454de2a5b (patch) | |
tree | 1b9c2122cffc009f261eb95ae3cb640ea66eb030 /services | |
parent | 538b002046b567ed3c431633623f335b90476e40 (diff) | |
download | platform_external_arm-trusted-firmware-aeaa225cbe24d63539261210e5aa901454de2a5b.tar.gz platform_external_arm-trusted-firmware-aeaa225cbe24d63539261210e5aa901454de2a5b.tar.bz2 platform_external_arm-trusted-firmware-aeaa225cbe24d63539261210e5aa901454de2a5b.zip |
spm-mm: Refactor secure_partition.h and its contents
Before adding any new SPM-related components we should first do
some cleanup around the existing SPM-MM implementation. The aim
is to make sure that any SPM-MM components have names that clearly
indicate that they are MM-related. Otherwise, when adding new SPM
code, it could quickly become confusing as it would be unclear to
which component the code belongs.
The secure_partition.h header is a clear example of this, as the
name is generic so it could easily apply to any SPM-related code,
when it is in fact SPM-MM specific.
This patch renames the file and the two structures defined within
it, and then modifies any references in files that use the header.
Change-Id: I44bd95fab774c358178b3e81262a16da500fda26
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/std_svc/spm_mm/spm_main.c | 2 | ||||
-rw-r--r-- | services/std_svc/spm_mm/spm_setup.c | 24 | ||||
-rw-r--r-- | services/std_svc/spm_mm/spm_xlat.c | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/services/std_svc/spm_mm/spm_main.c b/services/std_svc/spm_mm/spm_main.c index 706b69d9f..b2f93a636 100644 --- a/services/std_svc/spm_mm/spm_main.c +++ b/services/std_svc/spm_mm/spm_main.c @@ -19,7 +19,7 @@ #include <lib/xlat_tables/xlat_tables_v2.h> #include <plat/common/platform.h> #include <services/mm_svc.h> -#include <services/secure_partition.h> +#include <services/spm_mm_partition.h> #include <services/spm_svc.h> #include <smccc_helpers.h> diff --git a/services/std_svc/spm_mm/spm_setup.c b/services/std_svc/spm_mm/spm_setup.c index aae6cd5e2..7d03eb588 100644 --- a/services/std_svc/spm_mm/spm_setup.c +++ b/services/std_svc/spm_mm/spm_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -16,7 +16,7 @@ #include <platform_def.h> #include <plat/common/common_def.h> #include <plat/common/platform.h> -#include <services/secure_partition.h> +#include <services/spm_mm_partition.h> #include "spm_private.h" #include "spm_shim_private.h" @@ -192,22 +192,22 @@ void spm_sp_setup(sp_context_t *sp_ctx) void *shared_buf_ptr = (void *) PLAT_SPM_BUF_BASE; /* Copy the boot information into the shared buffer with the SP. */ - assert((uintptr_t)shared_buf_ptr + sizeof(secure_partition_boot_info_t) + assert((uintptr_t)shared_buf_ptr + sizeof(spm_mm_boot_info_t) <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE)); assert(PLAT_SPM_BUF_BASE <= (UINTPTR_MAX - PLAT_SPM_BUF_SIZE + 1)); - const secure_partition_boot_info_t *sp_boot_info = + const spm_mm_boot_info_t *sp_boot_info = plat_get_secure_partition_boot_info(NULL); assert(sp_boot_info != NULL); memcpy((void *) shared_buf_ptr, (const void *) sp_boot_info, - sizeof(secure_partition_boot_info_t)); + sizeof(spm_mm_boot_info_t)); /* Pointer to the MP information from the platform port. */ - secure_partition_mp_info_t *sp_mp_info = - ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info; + spm_mm_mp_info_t *sp_mp_info = + ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info; assert(sp_mp_info != NULL); @@ -215,15 +215,15 @@ void spm_sp_setup(sp_context_t *sp_ctx) * Point the shared buffer MP information pointer to where the info will * be populated, just after the boot info. */ - ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info = - (secure_partition_mp_info_t *) ((uintptr_t)shared_buf_ptr - + sizeof(secure_partition_boot_info_t)); + ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info = + (spm_mm_mp_info_t *) ((uintptr_t)shared_buf_ptr + + sizeof(spm_mm_boot_info_t)); /* * Update the shared buffer pointer to where the MP information for the * payload will be populated */ - shared_buf_ptr = ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info; + shared_buf_ptr = ((spm_mm_boot_info_t *) shared_buf_ptr)->mp_info; /* * Copy the cpu information into the shared buffer area after the boot @@ -242,7 +242,7 @@ void spm_sp_setup(sp_context_t *sp_ctx) * Calculate the linear indices of cores in boot information for the * secure partition and flag the primary CPU */ - sp_mp_info = (secure_partition_mp_info_t *) shared_buf_ptr; + sp_mp_info = (spm_mm_mp_info_t *) shared_buf_ptr; for (unsigned int index = 0; index < sp_boot_info->num_cpus; index++) { u_register_t mpidr = sp_mp_info[index].mpidr; diff --git a/services/std_svc/spm_mm/spm_xlat.c b/services/std_svc/spm_mm/spm_xlat.c index f54168e33..a2df1afb0 100644 --- a/services/std_svc/spm_mm/spm_xlat.c +++ b/services/std_svc/spm_mm/spm_xlat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,7 +11,7 @@ #include <lib/xlat_tables/xlat_tables_v2.h> #include <platform_def.h> #include <plat/common/platform.h> -#include <services/secure_partition.h> +#include <services/spm_mm_partition.h> #include <services/spm_svc.h> #include "spm_private.h" |