/* * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __SECURE_PARTITION_H__ #define __SECURE_PARTITION_H__ #include /* * Definitions used to access the members of secure_partition_boot_info from * assembly code. */ #define SP_BOOT_INFO_STACK_BASE_OFFSET U(32) #define SP_BOOT_INFO_IMAGE_SIZE_OFFSET U(64) #define SP_BOOT_INFO_PCPU_STACK_SIZE_OFFSET U(72) #ifndef __ASSEMBLY__ #include #include #include /* * Flags used by the secure_partition_mp_info structure to describe the * characteristics of a cpu. Only a single flag is defined at the moment to * indicate the primary cpu. */ #define MP_INFO_FLAG_PRIMARY_CPU U(0x00000001) /* * This structure is used to provide information required to initialise a S-EL0 * partition. */ typedef struct secure_partition_mp_info { u_register_t mpidr; unsigned int linear_id; unsigned int flags; } secure_partition_mp_info_t; typedef struct secure_partition_boot_info { param_header_t h; uintptr_t sp_mem_base; uintptr_t sp_mem_limit; uintptr_t sp_image_base; uintptr_t sp_stack_base; uintptr_t sp_heap_base; uintptr_t sp_ns_comm_buf_base; uintptr_t sp_shared_buf_base; size_t sp_image_size; size_t sp_pcpu_stack_size; size_t sp_heap_size; size_t sp_ns_comm_buf_size; size_t sp_shared_buf_size; unsigned int num_sp_mem_regions; unsigned int num_cpus; secure_partition_mp_info_t *mp_info; } secure_partition_boot_info_t; /* * Compile time assertions related to the 'secure_partition_boot_info' structure * to ensure that the assembler and the compiler view of the offsets of the * structure members is the same. */ CASSERT(SP_BOOT_INFO_STACK_BASE_OFFSET == __builtin_offsetof(secure_partition_boot_info_t, sp_stack_base), \ assert_secure_partition_boot_info_sp_stack_base_offset_mismatch); CASSERT(SP_BOOT_INFO_IMAGE_SIZE_OFFSET == __builtin_offsetof(secure_partition_boot_info_t, sp_image_size), \ assert_secure_partition_boot_info_sp_image_size_offset_mismatch); CASSERT(SP_BOOT_INFO_PCPU_STACK_SIZE_OFFSET == __builtin_offsetof(secure_partition_boot_info_t, sp_pcpu_stack_size), \ assert_secure_partition_boot_info_sp_pcpu_stack_size_offset_mismatch); #endif /* __ASSEMBLY__ */ #endif /* __SECURE_PARTITION_H__ */