Commit fb037bfb authored by Dan Handley's avatar Dan Handley
Browse files

Always use named structs in header files

Add tag names to all unnamed structs in header files. This
allows forward declaration of structs, which is necessary to
reduce header file nesting (to be implemented in a subsequent
commit).

Also change the typedef names across the codebase to use the _t
suffix to be more conformant with the Linux coding style. The
coding style actually prefers us not to use typedefs at all but
this is considered a step too far for Trusted Firmware.

Also change the IO framework structs defintions to use typedef'd
structs to be consistent with the rest of the codebase.

Change-Id: I722b2c86fc0d92e4da3b15e5cab20373dd26786f
parent c5945735
......@@ -51,8 +51,8 @@ void bl1_main(void)
#endif
unsigned long bl2_base;
unsigned int load_type = TOP_LOAD, spsr;
meminfo *bl1_tzram_layout;
meminfo *bl2_tzram_layout = 0x0;
meminfo_t *bl1_tzram_layout;
meminfo_t *bl2_tzram_layout = 0x0;
/*
* Ensure that MMU/Caches and coherency are turned on
......@@ -87,7 +87,7 @@ void bl1_main(void)
* to BL2. BL2 will read the memory layout before using its
* memory for other purposes.
*/
bl2_tzram_layout = (meminfo *) bl1_tzram_layout->free_base;
bl2_tzram_layout = (meminfo_t *) bl1_tzram_layout->free_base;
init_bl2_mem_layout(bl1_tzram_layout,
bl2_tzram_layout,
load_type,
......
......@@ -48,8 +48,8 @@
******************************************************************************/
void bl2_main(void)
{
meminfo *bl2_tzram_layout;
bl31_args *bl2_to_bl31_args;
meminfo_t *bl2_tzram_layout;
bl31_args_t *bl2_to_bl31_args;
unsigned long bl31_base, bl32_base = 0, bl33_base, el_status;
unsigned int bl2_load, bl31_load, mode;
......
......@@ -47,7 +47,7 @@
* for SP execution. In cases where both SPD and SP are absent, or when SPD
* finds it impossible to execute SP, this pointer is left as NULL
******************************************************************************/
static int32_t (*bl32_init)(meminfo *);
static int32_t (*bl32_init)(meminfo_t *);
/*******************************************************************************
* Variable to indicate whether next image to execute after BL31 is BL33
......@@ -153,7 +153,7 @@ uint32_t bl31_get_next_image_type(void)
******************************************************************************/
void bl31_prepare_next_image_entry()
{
el_change_info *next_image_info;
el_change_info_t *next_image_info;
uint32_t scr, image_type;
/* Determine which image to execute next */
......@@ -190,7 +190,7 @@ void bl31_prepare_next_image_entry()
* This function initializes the pointer to BL32 init function. This is expected
* to be called by the SPD after it finishes all its initialization
******************************************************************************/
void bl31_register_bl32_init(int32_t (*func)(meminfo *))
void bl31_register_bl32_init(int32_t (*func)(meminfo_t *))
{
bl32_init = func;
}
......@@ -45,9 +45,9 @@
******************************************************************************/
typedef struct {
void *ptr[2];
} __aligned (CACHE_WRITEBACK_GRANULE) context_info;
} __aligned (CACHE_WRITEBACK_GRANULE) context_info_t;
static context_info cm_context_info[PLATFORM_CORE_COUNT];
static context_info_t cm_context_info[PLATFORM_CORE_COUNT];
/*******************************************************************************
* Context management library initialisation routine. This library is used by
......@@ -104,7 +104,7 @@ void cm_set_context(uint64_t mpidr, void *context, uint32_t security_state)
******************************************************************************/
void cm_el3_sysregs_context_save(uint32_t security_state)
{
cpu_context *ctx;
cpu_context_t *ctx;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -114,7 +114,7 @@ void cm_el3_sysregs_context_save(uint32_t security_state)
void cm_el3_sysregs_context_restore(uint32_t security_state)
{
cpu_context *ctx;
cpu_context_t *ctx;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -124,7 +124,7 @@ void cm_el3_sysregs_context_restore(uint32_t security_state)
void cm_el1_sysregs_context_save(uint32_t security_state)
{
cpu_context *ctx;
cpu_context_t *ctx;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -134,7 +134,7 @@ void cm_el1_sysregs_context_save(uint32_t security_state)
void cm_el1_sysregs_context_restore(uint32_t security_state)
{
cpu_context *ctx;
cpu_context_t *ctx;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -151,8 +151,8 @@ void cm_el1_sysregs_context_restore(uint32_t security_state)
void cm_set_el3_eret_context(uint32_t security_state, uint64_t entrypoint,
uint32_t spsr, uint32_t scr)
{
cpu_context *ctx;
el3_state *state;
cpu_context_t *ctx;
el3_state_t *state;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -170,8 +170,8 @@ void cm_set_el3_eret_context(uint32_t security_state, uint64_t entrypoint,
******************************************************************************/
void cm_set_el3_elr(uint32_t security_state, uint64_t entrypoint)
{
cpu_context *ctx;
el3_state *state;
cpu_context_t *ctx;
el3_state_t *state;
ctx = cm_get_context(read_mpidr(), security_state);
assert(ctx);
......@@ -188,7 +188,7 @@ void cm_set_el3_elr(uint32_t security_state, uint64_t entrypoint)
******************************************************************************/
void cm_set_next_eret_context(uint32_t security_state)
{
cpu_context *ctx;
cpu_context_t *ctx;
#if DEBUG
uint64_t sp_mode;
#endif
......@@ -220,8 +220,8 @@ void cm_set_next_eret_context(uint32_t security_state)
******************************************************************************/
void cm_init_exception_stack(uint64_t mpidr, uint32_t security_state)
{
cpu_context *ctx;
el3_state *state;
cpu_context_t *ctx;
el3_state_t *state;
ctx = cm_get_context(mpidr, security_state);
assert(ctx);
......
......@@ -55,12 +55,12 @@
#define RT_SVC_DESCS_START ((uint64_t) (&__RT_SVC_DESCS_START__))
#define RT_SVC_DESCS_END ((uint64_t) (&__RT_SVC_DESCS_END__))
uint8_t rt_svc_descs_indices[MAX_RT_SVCS];
static rt_svc_desc *rt_svc_descs;
static rt_svc_desc_t *rt_svc_descs;
/*******************************************************************************
* Simple routine to sanity check a runtime service descriptor before using it
******************************************************************************/
static int32_t validate_rt_svc_desc(rt_svc_desc *desc)
static int32_t validate_rt_svc_desc(rt_svc_desc_t *desc)
{
if (desc == NULL)
return -EINVAL;
......@@ -96,14 +96,14 @@ void runtime_svc_init()
/* If no runtime services are implemented then simply bail out */
rt_svc_descs_num = RT_SVC_DESCS_END - RT_SVC_DESCS_START;
rt_svc_descs_num /= sizeof(rt_svc_desc);
rt_svc_descs_num /= sizeof(rt_svc_desc_t);
if (rt_svc_descs_num == 0)
return;
/* Initialise internal variables to invalid state */
memset(rt_svc_descs_indices, -1, sizeof(rt_svc_descs_indices));
rt_svc_descs = (rt_svc_desc *) RT_SVC_DESCS_START;
rt_svc_descs = (rt_svc_desc_t *) RT_SVC_DESCS_START;
for (index = 0; index < rt_svc_descs_num; index++) {
/*
......@@ -148,7 +148,7 @@ error:
void fault_handler(void *handle)
{
gp_regs *gpregs_ctx = get_gpregs_ctx(handle);
gp_regs_t *gpregs_ctx = get_gpregs_ctx(handle);
ERROR("Unhandled synchronous fault. Register dump @ 0x%x \n",
gpregs_ctx);
panic();
......
......@@ -45,19 +45,19 @@ spinlock_t console_lock;
* Per cpu data structure to populate parameters for an SMC in C code and use
* a pointer to this structure in assembler code to populate x0-x7
******************************************************************************/
static tsp_args tsp_smc_args[PLATFORM_CORE_COUNT];
static tsp_args_t tsp_smc_args[PLATFORM_CORE_COUNT];
/*******************************************************************************
* Per cpu data structure to keep track of TSP activity
******************************************************************************/
static work_statistics tsp_stats[PLATFORM_CORE_COUNT];
static work_statistics_t tsp_stats[PLATFORM_CORE_COUNT];
/*******************************************************************************
* Single reference to the various entry points exported by the test secure
* payload. A single copy should suffice for all cpus as they are not expected
* to change.
******************************************************************************/
static const entry_info tsp_entry_info = {
static const entry_info_t tsp_entry_info = {
tsp_fast_smc_entry,
tsp_cpu_on_entry,
tsp_cpu_off_entry,
......@@ -65,7 +65,7 @@ static const entry_info tsp_entry_info = {
tsp_cpu_suspend_entry,
};
static tsp_args *set_smc_args(uint64_t arg0,
static tsp_args_t *set_smc_args(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -76,7 +76,7 @@ static tsp_args *set_smc_args(uint64_t arg0,
{
uint64_t mpidr = read_mpidr();
uint32_t linear_id;
tsp_args *pcpu_smc_args;
tsp_args_t *pcpu_smc_args;
/*
* Return to Secure Monitor by raising an SMC. The results of the
......@@ -107,7 +107,7 @@ uint64_t tsp_main(void)
uint32_t linear_id = platform_get_core_pos(mpidr);
#if DEBUG
meminfo *mem_layout = bl32_plat_sec_mem_layout();
meminfo_t *mem_layout = bl32_plat_sec_mem_layout();
#endif
/* Initialize the platform */
......@@ -145,7 +145,7 @@ uint64_t tsp_main(void)
* after this cpu's architectural state has been setup in response to an earlier
* psci cpu_on request.
******************************************************************************/
tsp_args *tsp_cpu_on_main(void)
tsp_args_t *tsp_cpu_on_main(void)
{
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
......@@ -171,7 +171,7 @@ tsp_args *tsp_cpu_on_main(void)
* This function performs any remaining book keeping in the test secure payload
* before this cpu is turned off in response to a psci cpu_off request.
******************************************************************************/
tsp_args *tsp_cpu_off_main(uint64_t arg0,
tsp_args_t *tsp_cpu_off_main(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -206,7 +206,7 @@ tsp_args *tsp_cpu_off_main(uint64_t arg0,
* this cpu's architectural state is saved in response to an earlier psci
* cpu_suspend request.
******************************************************************************/
tsp_args *tsp_cpu_suspend_main(uint64_t power_state,
tsp_args_t *tsp_cpu_suspend_main(uint64_t power_state,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -241,7 +241,7 @@ tsp_args *tsp_cpu_suspend_main(uint64_t power_state,
* cpu's architectural state has been restored after wakeup from an earlier psci
* cpu_suspend request.
******************************************************************************/
tsp_args *tsp_cpu_resume_main(uint64_t suspend_level,
tsp_args_t *tsp_cpu_resume_main(uint64_t suspend_level,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -277,7 +277,7 @@ tsp_args *tsp_cpu_resume_main(uint64_t suspend_level,
* in the function arguments in order. Once the service is rendered, this
* function returns to Secure Monitor by raising SMC
******************************************************************************/
tsp_args *tsp_fast_smc_handler(uint64_t func,
tsp_args_t *tsp_fast_smc_handler(uint64_t func,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......
......@@ -74,7 +74,7 @@ void change_security_state(unsigned int target_security_state)
write_scr(scr);
}
void __dead2 drop_el(aapcs64_params *args,
void __dead2 drop_el(aapcs64_params_t *args,
unsigned long spsr,
unsigned long entrypoint)
{
......@@ -90,7 +90,7 @@ void __dead2 drop_el(aapcs64_params *args,
args->arg7);
}
void __dead2 raise_el(aapcs64_params *args)
void __dead2 raise_el(aapcs64_params_t *args)
{
smc(args->arg0,
args->arg1,
......@@ -107,7 +107,7 @@ void __dead2 raise_el(aapcs64_params *args)
* Add support for dropping into EL0 etc. Consider adding support
* for switching from S-EL1 to S-EL0/1 etc.
*/
void __dead2 change_el(el_change_info *info)
void __dead2 change_el(el_change_info_t *info)
{
unsigned long current_el = read_current_el();
......@@ -156,8 +156,8 @@ unsigned long make_spsr(unsigned long target_el,
* TODO: Revisit if this and init_bl2_mem_layout can be replaced by a single
* routine.
******************************************************************************/
void init_bl31_mem_layout(const meminfo *bl2_mem_layout,
meminfo *bl31_mem_layout,
void init_bl31_mem_layout(const meminfo_t *bl2_mem_layout,
meminfo_t *bl31_mem_layout,
unsigned int load_type)
{
if (load_type == BOT_LOAD) {
......@@ -200,7 +200,7 @@ void init_bl31_mem_layout(const meminfo *bl2_mem_layout,
bl31_mem_layout->total_size = bl2_mem_layout->total_size;
bl31_mem_layout->attr = load_type;
flush_dcache_range((unsigned long) bl31_mem_layout, sizeof(meminfo));
flush_dcache_range((unsigned long) bl31_mem_layout, sizeof(meminfo_t));
return;
}
......@@ -210,8 +210,8 @@ void init_bl31_mem_layout(const meminfo *bl2_mem_layout,
* this information, it populates bl2_mem_layout to tell BL2 how much memory
* it has access to and how much is available for use.
******************************************************************************/
void init_bl2_mem_layout(meminfo *bl1_mem_layout,
meminfo *bl2_mem_layout,
void init_bl2_mem_layout(meminfo_t *bl1_mem_layout,
meminfo_t *bl2_mem_layout,
unsigned int load_type,
unsigned long bl2_base)
{
......@@ -232,13 +232,13 @@ void init_bl2_mem_layout(meminfo *bl1_mem_layout,
bl2_mem_layout->free_size = bl1_mem_layout->free_size;
bl2_mem_layout->attr = load_type;
flush_dcache_range((unsigned long) bl2_mem_layout, sizeof(meminfo));
flush_dcache_range((unsigned long) bl2_mem_layout, sizeof(meminfo_t));
return;
}
static void dump_load_info(unsigned long image_load_addr,
unsigned long image_size,
const meminfo *mem_layout)
const meminfo_t *mem_layout)
{
#if DEBUG
printf("Trying to load image at address 0x%lx, size = 0x%lx\r\n",
......@@ -301,7 +301,7 @@ unsigned long image_size(const char *image_name)
* the bottom or top of the free memory. It updates the memory layout if the
* load is successful.
******************************************************************************/
unsigned long load_image(meminfo *mem_layout,
unsigned long load_image(meminfo_t *mem_layout,
const char *image_name,
unsigned int load_type,
unsigned long fixed_addr)
......@@ -553,7 +553,7 @@ void __dead2 run_image(unsigned long entrypoint,
void *first_arg,
void *second_arg)
{
el_change_info run_image_info;
el_change_info_t run_image_info;
unsigned long current_el = read_current_el();
/* Tell next EL what we want done */
......
......@@ -49,7 +49,7 @@ static void tzc_write_gate_keeper(uint64_t base, uint32_t val)
mmio_write_32(base + GATE_KEEPER_OFF, val);
}
static void tzc_write_action(uint64_t base, enum tzc_action action)
static void tzc_write_action(uint64_t base, tzc_action_t action)
{
mmio_write_32(base + ACTION_OFF, action);
}
......@@ -130,7 +130,7 @@ static void tzc_set_gate_keeper(uint64_t base, uint8_t filter, uint32_t val)
}
void tzc_init(struct tzc_instance *controller)
void tzc_init(tzc_instance_t *controller)
{
uint32_t tzc_id, tzc_build;
......@@ -166,12 +166,12 @@ void tzc_init(struct tzc_instance *controller)
* this cannot be changed. It is, however, possible to change some region 0
* permissions.
*/
void tzc_configure_region(const struct tzc_instance *controller,
void tzc_configure_region(const tzc_instance_t *controller,
uint32_t filters,
uint8_t region,
uint64_t region_base,
uint64_t region_top,
enum tzc_region_attributes sec_attr,
tzc_region_attributes_t sec_attr,
uint32_t ns_device_access)
{
uint64_t max_addr;
......@@ -218,7 +218,7 @@ void tzc_configure_region(const struct tzc_instance *controller,
}
void tzc_set_action(const struct tzc_instance *controller, enum tzc_action action)
void tzc_set_action(const tzc_instance_t *controller, tzc_action_t action)
{
assert(controller != NULL);
......@@ -231,7 +231,7 @@ void tzc_set_action(const struct tzc_instance *controller, enum tzc_action actio
}
void tzc_enable_filters(const struct tzc_instance *controller)
void tzc_enable_filters(const tzc_instance_t *controller)
{
uint32_t state;
uint32_t filter;
......@@ -250,7 +250,7 @@ void tzc_enable_filters(const struct tzc_instance *controller)
}
void tzc_disable_filters(const struct tzc_instance *controller)
void tzc_disable_filters(const tzc_instance_t *controller)
{
uint32_t filter;
......
......@@ -51,7 +51,7 @@
typedef struct {
const char *name;
const uuid_t uuid;
} plat_fip_name_uuid;
} plat_fip_name_uuid_t;
typedef struct {
/* Put file_pos above the struct to allow {0} on static init.
......@@ -59,10 +59,10 @@ typedef struct {
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
*/
unsigned int file_pos;
fip_toc_entry entry;
} file_state;
fip_toc_entry_t entry;
} file_state_t;
static plat_fip_name_uuid name_uuid[] = {
static plat_fip_name_uuid_t name_uuid[] = {
{BL2_IMAGE_NAME, UUID_TRUSTED_BOOT_FIRMWARE_BL2},
{BL31_IMAGE_NAME, UUID_EL3_RUNTIME_FIRMWARE_BL31},
{BL32_IMAGE_NAME, UUID_SECURE_PAYLOAD_BL32},
......@@ -70,21 +70,21 @@ static plat_fip_name_uuid name_uuid[] = {
};
static const uuid_t uuid_null = {0};
static file_state current_file = {0};
static file_state_t current_file = {0};
static io_dev_handle backend_dev_handle;
static void *backend_image_spec;
/* Firmware Image Package driver functions */
static int fip_dev_open(void *spec, struct io_dev_info **dev_info);
static int fip_file_open(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity);
static int fip_file_len(struct io_entity *entity, size_t *length);
static int fip_file_read(struct io_entity *entity, void *buffer, size_t length,
static int fip_dev_open(void *spec, io_dev_info_t **dev_info);
static int fip_file_open(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity);
static int fip_file_len(io_entity_t *entity, size_t *length);
static int fip_file_read(io_entity_t *entity, void *buffer, size_t length,
size_t *length_read);
static int fip_file_close(struct io_entity *entity);
static int fip_dev_init(struct io_dev_info *dev_info, const void *init_params);
static int fip_dev_close(struct io_dev_info *dev_info);
static int fip_file_close(io_entity_t *entity);
static int fip_dev_init(io_dev_info_t *dev_info, const void *init_params);
static int fip_dev_close(io_dev_info_t *dev_info);
static inline int copy_uuid(uuid_t *dst, const uuid_t *src)
......@@ -102,7 +102,7 @@ static inline int compare_uuids(const uuid_t *uuid1, const uuid_t *uuid2)
/* TODO: We could check version numbers or do a package checksum? */
static inline int is_valid_header(fip_toc_header *header)
static inline int is_valid_header(fip_toc_header_t *header)
{
if ((header->name == TOC_HEADER_NAME) && (header->serial_number != 0)) {
return 1;
......@@ -129,7 +129,7 @@ static int file_to_uuid(const char *filename, uuid_t *uuid)
/* Identify the device type as a virtual driver */
io_type device_type_fip(void)
io_type_t device_type_fip(void)
{
return IO_TYPE_FIRMWARE_IMAGE_PACKAGE;
}
......@@ -161,7 +161,7 @@ static struct io_dev_info fip_dev_info = {
/* Open a connection to the FIP device */
static int fip_dev_open(void *spec __attribute__((unused)),
struct io_dev_info **dev_info)
io_dev_info_t **dev_info)
{
assert(dev_info != NULL);
*dev_info = &fip_dev_info;
......@@ -171,12 +171,12 @@ static int fip_dev_open(void *spec __attribute__((unused)),
/* Do some basic package checks. */
static int fip_dev_init(struct io_dev_info *dev_info, const void *init_params)
static int fip_dev_init(io_dev_info_t *dev_info, const void *init_params)
{
int result = IO_FAIL;
char *image_name = (char *)init_params;
io_handle backend_handle;
fip_toc_header header;
fip_toc_header_t header;
size_t bytes_read;
/* Obtain a reference to the image by querying the platform layer */
......@@ -215,7 +215,7 @@ static int fip_dev_init(struct io_dev_info *dev_info, const void *init_params)
}
/* Close a connection to the FIP device */
static int fip_dev_close(struct io_dev_info *dev_info)
static int fip_dev_close(io_dev_info_t *dev_info)
{
/* TODO: Consider tracking open files and cleaning them up here */
......@@ -228,13 +228,13 @@ static int fip_dev_close(struct io_dev_info *dev_info)
/* Open a file for access from package. */
static int fip_file_open(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity)
static int fip_file_open(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity)
{
int result = IO_FAIL;
io_handle backend_handle;
uuid_t file_uuid;
const io_file_spec *file_spec = (io_file_spec *)spec;
const io_file_spec_t *file_spec = (io_file_spec_t *)spec;
size_t bytes_read;
int found_file = 0;
......@@ -262,7 +262,7 @@ static int fip_file_open(struct io_dev_info *dev_info, const void *spec,
}
/* Seek past the FIP header into the Table of Contents */
result = io_seek(backend_handle, IO_SEEK_SET, sizeof(fip_toc_header));
result = io_seek(backend_handle, IO_SEEK_SET, sizeof(fip_toc_header_t));
if (result != IO_SUCCESS) {
WARN("fip_file_open: failed to seek\n");
result = IO_FAIL;
......@@ -310,23 +310,23 @@ static int fip_file_open(struct io_dev_info *dev_info, const void *spec,
/* Return the size of a file in package */
static int fip_file_len(struct io_entity *entity, size_t *length)
static int fip_file_len(io_entity_t *entity, size_t *length)
{
assert(entity != NULL);
assert(length != NULL);
*length = ((file_state *)entity->info)->entry.size;
*length = ((file_state_t *)entity->info)->entry.size;
return IO_SUCCESS;
}
/* Read data from a file in package */
static int fip_file_read(struct io_entity *entity, void *buffer, size_t length,
static int fip_file_read(io_entity_t *entity, void *buffer, size_t length,
size_t *length_read)
{
int result = IO_FAIL;
file_state *fp;
file_state_t *fp;
size_t file_offset;
size_t bytes_read;
io_handle backend_handle;
......@@ -345,7 +345,7 @@ static int fip_file_read(struct io_entity *entity, void *buffer, size_t length,
goto fip_file_read_exit;
}
fp = (file_state *)entity->info;
fp = (file_state_t *)entity->info;
/* Seek to the position in the FIP where the payload lives */
file_offset = fp->entry.offset_address + fp->file_pos;
......@@ -378,7 +378,7 @@ static int fip_file_read(struct io_entity *entity, void *buffer, size_t length,
/* Close a file in package */
static int fip_file_close(struct io_entity *entity)
static int fip_file_close(io_entity_t *entity)
{
/* Clear our current file pointer.
* If we had malloc() we would free() here.
......@@ -396,7 +396,7 @@ static int fip_file_close(struct io_entity *entity)
/* Exported functions */
/* Register the Firmware Image Package driver with the IO abstraction */
int register_io_dev_fip(struct io_dev_connector **dev_con)
int register_io_dev_fip(io_dev_connector_t **dev_con)
{
int result = IO_FAIL;
assert(dev_con != NULL);
......
......@@ -45,28 +45,28 @@ typedef struct {
int in_use;
size_t base;
size_t file_pos;
} file_state;
} file_state_t;
static file_state current_file = {0};
static file_state_t current_file = {0};
/* Identify the device type as memmap */
io_type device_type_memmap(void)
io_type_t device_type_memmap(void)
{
return IO_TYPE_MEMMAP;
}
/* Memmap device functions */
static int memmap_dev_open(void *spec, struct io_dev_info **dev_info);
static int memmap_block_open(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity);
static int memmap_block_seek(struct io_entity *entity, int mode,
static int memmap_dev_open(void *spec, io_dev_info_t **dev_info);
static int memmap_block_open(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity);
static int memmap_block_seek(io_entity_t *entity, int mode,
ssize_t offset);
static int memmap_block_read(struct io_entity *entity, void *buffer,
static int memmap_block_read(io_entity_t *entity, void *buffer,
size_t length, size_t *length_read);
static int memmap_block_write(struct io_entity *entity, const void *buffer,
static int memmap_block_write(io_entity_t *entity, const void *buffer,
size_t length, size_t *length_written);
static int memmap_block_close(struct io_entity *entity);
static int memmap_dev_close(struct io_dev_info *dev_info);
static int memmap_block_close(io_entity_t *entity);
static int memmap_dev_close(io_dev_info_t *dev_info);
static struct io_dev_connector memmap_dev_connector = {
......@@ -95,7 +95,7 @@ static struct io_dev_info memmap_dev_info = {
/* Open a connection to the memmap device */
static int memmap_dev_open(void *spec __attribute__((unused)),
struct io_dev_info **dev_info)
io_dev_info_t **dev_info)
{
assert(dev_info != NULL);
*dev_info = &memmap_dev_info;
......@@ -106,7 +106,7 @@ static int memmap_dev_open(void *spec __attribute__((unused)),
/* Close a connection to the memmap device */
static int memmap_dev_close(struct io_dev_info *dev_info)
static int memmap_dev_close(io_dev_info_t *dev_info)
{
/* NOP */
/* TODO: Consider tracking open files and cleaning them up here */
......@@ -116,11 +116,11 @@ static int memmap_dev_close(struct io_dev_info *dev_info)
/* Open a file on the memmap device */
/* TODO: Can we do any sensible limit checks on requested memory */
static int memmap_block_open(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity)
static int memmap_block_open(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity)
{
int result = IO_FAIL;
const io_block_spec *block_spec = (io_block_spec *)spec;
const io_block_spec_t *block_spec = (io_block_spec_t *)spec;
/* Since we need to track open state for seek() we only allow one open
* spec at a time. When we have dynamic memory we can malloc and set
......@@ -146,7 +146,7 @@ static int memmap_block_open(struct io_dev_info *dev_info, const void *spec,
/* Seek to a particular file offset on the memmap device */
static int memmap_block_seek(struct io_entity *entity, int mode, ssize_t offset)
static int memmap_block_seek(io_entity_t *entity, int mode, ssize_t offset)
{
int result = IO_FAIL;
......@@ -155,7 +155,7 @@ static int memmap_block_seek(struct io_entity *entity, int mode, ssize_t offset)
assert(entity != NULL);
/* TODO: can we do some basic limit checks on seek? */
((file_state *)entity->info)->file_pos = offset;
((file_state_t *)entity->info)->file_pos = offset;
result = IO_SUCCESS;
} else {
result = IO_FAIL;
......@@ -166,16 +166,16 @@ static int memmap_block_seek(struct io_entity *entity, int mode, ssize_t offset)
/* Read data from a file on the memmap device */
static int memmap_block_read(struct io_entity *entity, void *buffer,
static int memmap_block_read(io_entity_t *entity, void *buffer,
size_t length, size_t *length_read)
{
file_state *fp;
file_state_t *fp;
assert(entity != NULL);
assert(buffer != NULL);
assert(length_read != NULL);
fp = (file_state *)entity->info;
fp = (file_state_t *)entity->info;
memcpy(buffer, (void *)(fp->base + fp->file_pos), length);
......@@ -188,16 +188,16 @@ static int memmap_block_read(struct io_entity *entity, void *buffer,
/* Write data to a file on the memmap device */
static int memmap_block_write(struct io_entity *entity, const void *buffer,
static int memmap_block_write(io_entity_t *entity, const void *buffer,
size_t length, size_t *length_written)
{
file_state *fp;
file_state_t *fp;
assert(entity != NULL);
assert(buffer != NULL);
assert(length_written != NULL);
fp = (file_state *)entity->info;
fp = (file_state_t *)entity->info;
memcpy((void *)(fp->base + fp->file_pos), buffer, length);
......@@ -211,7 +211,7 @@ static int memmap_block_write(struct io_entity *entity, const void *buffer,
/* Close a file on the memmap device */
static int memmap_block_close(struct io_entity *entity)
static int memmap_block_close(io_entity_t *entity)
{
assert(entity != NULL);
......@@ -227,7 +227,7 @@ static int memmap_block_close(struct io_entity *entity)
/* Exported functions */
/* Register the memmap driver with the IO abstraction */
int register_io_dev_memmap(struct io_dev_connector **dev_con)
int register_io_dev_memmap(io_dev_connector_t **dev_con)
{
int result = IO_FAIL;
assert(dev_con != NULL);
......
......@@ -36,7 +36,7 @@
/* Identify the device type as semihosting */
static io_type device_type_sh(void)
static io_type_t device_type_sh(void)
{
return IO_TYPE_SEMIHOSTING;
}
......@@ -44,16 +44,16 @@ static io_type device_type_sh(void)
/* Semi-hosting functions, device info and handle */
static int sh_dev_open(void *spec, struct io_dev_info **dev_info);
static int sh_file_open(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity);
static int sh_file_seek(struct io_entity *entity, int mode, ssize_t offset);
static int sh_file_len(struct io_entity *entity, size_t *length);
static int sh_file_read(struct io_entity *entity, void *buffer, size_t length,
static int sh_dev_open(void *spec, io_dev_info_t **dev_info);
static int sh_file_open(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity);
static int sh_file_seek(io_entity_t *entity, int mode, ssize_t offset);
static int sh_file_len(io_entity_t *entity, size_t *length);
static int sh_file_read(io_entity_t *entity, void *buffer, size_t length,
size_t *length_read);
static int sh_file_write(struct io_entity *entity, const void *buffer,
static int sh_file_write(io_entity_t *entity, const void *buffer,
size_t length, size_t *length_written);
static int sh_file_close(struct io_entity *entity);
static int sh_file_close(io_entity_t *entity);
static struct io_dev_connector sh_dev_connector = {
.dev_open = sh_dev_open
......@@ -80,7 +80,7 @@ static struct io_dev_info sh_dev_info = {
/* Open a connection to the semi-hosting device */
static int sh_dev_open(void *spec __unused, struct io_dev_info **dev_info)
static int sh_dev_open(void *spec __unused, io_dev_info_t **dev_info)
{
int result = IO_SUCCESS;
assert(dev_info != NULL);
......@@ -90,12 +90,12 @@ static int sh_dev_open(void *spec __unused, struct io_dev_info **dev_info)
/* Open a file on the semi-hosting device */
static int sh_file_open(struct io_dev_info *dev_info __attribute__((unused)),
const void *spec, struct io_entity *entity)
static int sh_file_open(io_dev_info_t *dev_info __attribute__((unused)),
const void *spec, io_entity_t *entity)
{
int result = IO_FAIL;
long sh_result = -1;
const io_file_spec *file_spec = (io_file_spec *)spec;
const io_file_spec_t *file_spec = (io_file_spec_t *)spec;
assert(file_spec != NULL);
assert(entity != NULL);
......@@ -113,7 +113,7 @@ static int sh_file_open(struct io_dev_info *dev_info __attribute__((unused)),
/* Seek to a particular file offset on the semi-hosting device */
static int sh_file_seek(struct io_entity *entity, int mode, ssize_t offset)
static int sh_file_seek(io_entity_t *entity, int mode, ssize_t offset)
{
int result = IO_FAIL;
long file_handle, sh_result;
......@@ -131,7 +131,7 @@ static int sh_file_seek(struct io_entity *entity, int mode, ssize_t offset)
/* Return the size of a file on the semi-hosting device */
static int sh_file_len(struct io_entity *entity, size_t *length)
static int sh_file_len(io_entity_t *entity, size_t *length)
{
int result = IO_FAIL;
......@@ -151,7 +151,7 @@ static int sh_file_len(struct io_entity *entity, size_t *length)
/* Read data from a file on the semi-hosting device */
static int sh_file_read(struct io_entity *entity, void *buffer, size_t length,
static int sh_file_read(io_entity_t *entity, void *buffer, size_t length,
size_t *length_read)
{
int result = IO_FAIL;
......@@ -178,7 +178,7 @@ static int sh_file_read(struct io_entity *entity, void *buffer, size_t length,
/* Write data to a file on the semi-hosting device */
static int sh_file_write(struct io_entity *entity, const void *buffer,
static int sh_file_write(io_entity_t *entity, const void *buffer,
size_t length, size_t *length_written)
{
int result = IO_FAIL;
......@@ -205,7 +205,7 @@ static int sh_file_write(struct io_entity *entity, const void *buffer,
/* Close a file on the semi-hosting device */
static int sh_file_close(struct io_entity *entity)
static int sh_file_close(io_entity_t *entity)
{
int result = IO_FAIL;
long sh_result = -1;
......@@ -226,7 +226,7 @@ static int sh_file_close(struct io_entity *entity)
/* Exported functions */
/* Register the semi-hosting driver with the IO abstraction */
int register_io_dev_sh(struct io_dev_connector **dev_con)
int register_io_dev_sh(io_dev_connector_t **dev_con)
{
int result = IO_FAIL;
assert(dev_con != NULL);
......
......@@ -39,7 +39,7 @@
* Function prototypes
*****************************************/
extern void bl1_platform_setup(void);
extern meminfo *bl1_plat_sec_mem_layout(void);
extern meminfo_t *bl1_plat_sec_mem_layout(void);
#endif /*__ASSEMBLY__*/
......
......@@ -42,7 +42,7 @@ extern unsigned long long bl2_entrypoint;
* Function prototypes
*****************************************/
extern void bl2_platform_setup(void);
extern meminfo *bl2_plat_sec_mem_layout(void);
extern bl31_args *bl2_get_bl31_args_ptr(void);
extern meminfo_t *bl2_plat_sec_mem_layout(void);
extern bl31_args_t *bl2_get_bl31_args_ptr(void);
#endif /* __BL2_H__ */
......@@ -46,9 +46,9 @@ extern void bl31_next_el_arch_setup(uint32_t security_state);
extern void bl31_set_next_image_type(uint32_t type);
extern uint32_t bl31_get_next_image_type(void);
extern void bl31_prepare_next_image_entry();
extern el_change_info *bl31_get_next_image_info(uint32_t type);
extern el_change_info_t *bl31_get_next_image_info(uint32_t type);
extern void bl31_platform_setup(void);
extern meminfo *bl31_plat_get_bl32_mem_layout(void);
extern meminfo *bl31_plat_sec_mem_layout(void);
extern void bl31_register_bl32_init(int32_t (*)(meminfo *));
extern meminfo_t *bl31_plat_get_bl32_mem_layout(void);
extern meminfo_t *bl31_plat_sec_mem_layout(void);
extern void bl31_register_bl32_init(int32_t (*)(meminfo_t *));
#endif /* __BL31_H__ */
......@@ -177,9 +177,9 @@
*/
#define DWORD_SHIFT 3
#define DEFINE_REG_STRUCT(name, num_regs) \
typedef struct { \
typedef struct name { \
uint64_t _regs[num_regs]; \
} __aligned(16) name
} __aligned(16) name##_t
/* Constants to determine the size of individual context structures */
#define CTX_GPREG_ALL (CTX_GPREGS_END >> DWORD_SHIFT)
......@@ -232,31 +232,31 @@ DEFINE_REG_STRUCT(el3_state, CTX_EL3STATE_ALL);
* structure at exception entry and exit. Each instance will
* correspond to either the secure or the non-secure state.
*/
typedef struct {
gp_regs gpregs_ctx;
el3_state el3state_ctx;
el1_sys_regs sysregs_ctx;
fp_regs fpregs_ctx;
} cpu_context;
typedef struct cpu_context {
gp_regs_t gpregs_ctx;
el3_state_t el3state_ctx;
el1_sys_regs_t sysregs_ctx;
fp_regs_t fpregs_ctx;
} cpu_context_t;
/* Macros to access members of the 'cpu_context' structure */
#define get_el3state_ctx(h) (&((cpu_context *) h)->el3state_ctx)
#define get_fpregs_ctx(h) (&((cpu_context *) h)->fpregs_ctx)
#define get_sysregs_ctx(h) (&((cpu_context *) h)->sysregs_ctx)
#define get_gpregs_ctx(h) (&((cpu_context *) h)->gpregs_ctx)
/* Macros to access members of the 'cpu_context_t' structure */
#define get_el3state_ctx(h) (&((cpu_context_t *) h)->el3state_ctx)
#define get_fpregs_ctx(h) (&((cpu_context_t *) h)->fpregs_ctx)
#define get_sysregs_ctx(h) (&((cpu_context_t *) h)->sysregs_ctx)
#define get_gpregs_ctx(h) (&((cpu_context_t *) h)->gpregs_ctx)
/*
* Compile time assertions related to the 'cpu_context' structure to
* ensure that the assembler and the compiler view of the offsets of
* the structure members is the same.
*/
CASSERT(CTX_GPREGS_OFFSET == __builtin_offsetof(cpu_context, gpregs_ctx), \
CASSERT(CTX_GPREGS_OFFSET == __builtin_offsetof(cpu_context_t, gpregs_ctx), \
assert_core_context_gp_offset_mismatch);
CASSERT(CTX_SYSREGS_OFFSET == __builtin_offsetof(cpu_context, sysregs_ctx), \
CASSERT(CTX_SYSREGS_OFFSET == __builtin_offsetof(cpu_context_t, sysregs_ctx), \
assert_core_context_sys_offset_mismatch);
CASSERT(CTX_FPREGS_OFFSET == __builtin_offsetof(cpu_context, fpregs_ctx), \
CASSERT(CTX_FPREGS_OFFSET == __builtin_offsetof(cpu_context_t, fpregs_ctx), \
assert_core_context_fp_offset_mismatch);
CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context, el3state_ctx), \
CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context_t, el3state_ctx), \
assert_core_context_el3state_offset_mismatch);
/*
......@@ -298,12 +298,12 @@ CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context, el3state_ctx), \
/*******************************************************************************
* Function prototypes
******************************************************************************/
void el3_sysregs_context_save(el3_state *regs);
void el3_sysregs_context_restore(el3_state *regs);
void el1_sysregs_context_save(el1_sys_regs *regs);
void el1_sysregs_context_restore(el1_sys_regs *regs);
void fpregs_context_save(fp_regs *regs);
void fpregs_context_restore(fp_regs *regs);
void el3_sysregs_context_save(el3_state_t *regs);
void el3_sysregs_context_restore(el3_state_t *regs);
void el1_sysregs_context_save(el1_sys_regs_t *regs);
void el1_sysregs_context_restore(el1_sys_regs_t *regs);
void fpregs_context_save(fp_regs_t *regs);
void fpregs_context_restore(fp_regs_t *regs);
#undef CTX_SYSREG_ALL
#undef CTX_FP_ALL
......
......@@ -130,7 +130,7 @@
#define is_caller_secure(_f) (!(is_caller_non_secure(_f)))
/* Prototype for runtime service initializing function */
typedef int32_t (*rt_svc_init)(void);
typedef int32_t (*rt_svc_init_t)(void);
/* Convenience macros to return from SMC handler */
#define SMC_RET1(_h, _x0) { \
......@@ -175,7 +175,7 @@ typedef int32_t (*rt_svc_init)(void);
* can be accessed using the handle pointer. The cookie parameter is reserved
* for future use
*/
typedef uint64_t (*rt_svc_handle)(uint32_t smc_fid,
typedef uint64_t (*rt_svc_handle_t)(uint32_t smc_fid,
uint64_t x1,
uint64_t x2,
uint64_t x3,
......@@ -183,20 +183,20 @@ typedef uint64_t (*rt_svc_handle)(uint32_t smc_fid,
void *cookie,
void *handle,
uint64_t flags);
typedef struct {
typedef struct rt_svc_desc {
uint8_t start_oen;
uint8_t end_oen;
uint8_t call_type;
const char *name;
rt_svc_init init;
rt_svc_handle handle;
} rt_svc_desc;
rt_svc_init_t init;
rt_svc_handle_t handle;
} rt_svc_desc_t;
/*
* Convenience macro to declare a service descriptor
*/
#define DECLARE_RT_SVC(_name, _start, _end, _type, _setup, _smch) \
static const rt_svc_desc __svc_desc_ ## _name \
static const rt_svc_desc_t __svc_desc_ ## _name \
__attribute__ ((section("rt_svc_descs"), used)) = { \
_start, \
_end, \
......@@ -214,11 +214,11 @@ typedef struct {
* 3. ensure that the assembler and the compiler see the handler
* routine at the same offset.
*/
CASSERT((sizeof(rt_svc_desc) == SIZEOF_RT_SVC_DESC), \
CASSERT((sizeof(rt_svc_desc_t) == SIZEOF_RT_SVC_DESC), \
assert_sizeof_rt_svc_desc_mismatch);
CASSERT(RT_SVC_DESC_INIT == __builtin_offsetof(rt_svc_desc, init), \
CASSERT(RT_SVC_DESC_INIT == __builtin_offsetof(rt_svc_desc_t, init), \
assert_rt_svc_desc_init_offset_mismatch);
CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc, handle), \
CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc_t, handle), \
assert_rt_svc_desc_handle_offset_mismatch);
......
......@@ -135,7 +135,7 @@
* Structure populated by platform specific code to export routines which
* perform common low level pm functions
******************************************************************************/
typedef struct {
typedef struct plat_pm_ops {
int (*affinst_standby)(unsigned int);
int (*affinst_on)(unsigned long,
unsigned long,
......@@ -152,7 +152,7 @@ typedef struct {
int (*affinst_suspend_finish)(unsigned long,
unsigned int,
unsigned int);
} plat_pm_ops;
} plat_pm_ops_t;
/*******************************************************************************
* Optional structure populated by the Secure Payload Dispatcher to be given a
......@@ -160,7 +160,7 @@ typedef struct {
* operation. It also allows PSCI to determine certain properties of the SP e.g.
* migrate capability etc.
******************************************************************************/
typedef struct {
typedef struct spd_pm_ops {
void (*svc_on)(uint64_t target_cpu);
int32_t (*svc_off)(uint64_t __unused);
void (*svc_suspend)(uint64_t power_state);
......@@ -168,7 +168,7 @@ typedef struct {
void (*svc_suspend_finish)(uint64_t suspend_level);
void (*svc_migrate)(uint64_t __unused1, uint64_t __unused2);
int32_t (*svc_migrate_info)(uint64_t *__unused);
} spd_pm_ops;
} spd_pm_ops_t;
/*******************************************************************************
* Function & Data prototypes
......@@ -187,7 +187,7 @@ extern int psci_cpu_on(unsigned long,
unsigned long);
extern void psci_aff_on_finish_entry(void);
extern void psci_aff_suspend_finish_entry(void);
extern void psci_register_spd_pm_hook(const spd_pm_ops *);
extern void psci_register_spd_pm_hook(const spd_pm_ops_t *);
extern int psci_get_suspend_stateid(unsigned long mpidr);
extern int psci_get_suspend_afflvl(unsigned long mpidr);
......
......@@ -37,7 +37,7 @@
#include <bl_common.h>
extern void bl32_platform_setup(void);
extern meminfo *bl32_plat_sec_mem_layout(void);
extern meminfo_t *bl32_plat_sec_mem_layout(void);
extern uint64_t bl32_main(void);
#endif /* __ASSEMBLY__ */
......
......@@ -88,7 +88,7 @@
#ifndef __ASSEMBLY__
#include <stdint.h>
typedef void (*tsp_generic_fptr)(uint64_t arg0,
typedef void (*tsp_generic_fptr_t)(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -97,26 +97,26 @@ typedef void (*tsp_generic_fptr)(uint64_t arg0,
uint64_t arg6,
uint64_t arg7);
typedef struct {
tsp_generic_fptr fast_smc_entry;
tsp_generic_fptr cpu_on_entry;
tsp_generic_fptr cpu_off_entry;
tsp_generic_fptr cpu_resume_entry;
tsp_generic_fptr cpu_suspend_entry;
} entry_info;
typedef struct entry_info {
tsp_generic_fptr_t fast_smc_entry;
tsp_generic_fptr_t cpu_on_entry;
tsp_generic_fptr_t cpu_off_entry;
tsp_generic_fptr_t cpu_resume_entry;
tsp_generic_fptr_t cpu_suspend_entry;
} entry_info_t;
typedef struct {
typedef struct work_statistics {
uint32_t smc_count; /* Number of returns on this cpu */
uint32_t eret_count; /* Number of entries on this cpu */
uint32_t cpu_on_count; /* Number of cpu on requests */
uint32_t cpu_off_count; /* Number of cpu off requests */
uint32_t cpu_suspend_count; /* Number of cpu suspend requests */
uint32_t cpu_resume_count; /* Number of cpu resume requests */
} __aligned(CACHE_WRITEBACK_GRANULE) work_statistics;
} __aligned(CACHE_WRITEBACK_GRANULE) work_statistics_t;
typedef struct {
typedef struct tsp_args {
uint64_t _regs[TSP_ARGS_END >> 3];
} __aligned(CACHE_WRITEBACK_GRANULE) tsp_args;
} __aligned(CACHE_WRITEBACK_GRANULE) tsp_args_t;
/* Macros to access members of the above structure using their offsets */
#define read_sp_arg(args, offset) ((args)->_regs[offset >> 3])
......@@ -127,7 +127,7 @@ typedef struct {
* Ensure that the assembler's view of the size of the tsp_args is the
* same as the compilers
*/
CASSERT(TSP_ARGS_SIZE == sizeof(tsp_args), assert_sp_args_size_mismatch);
CASSERT(TSP_ARGS_SIZE == sizeof(tsp_args_t), assert_sp_args_size_mismatch);
extern void tsp_get_magic(uint64_t args[4]);
......@@ -147,7 +147,7 @@ extern void tsp_cpu_resume_entry(uint64_t arg0,
uint64_t arg5,
uint64_t arg6,
uint64_t arg7);
extern tsp_args *tsp_cpu_resume_main(uint64_t arg0,
extern tsp_args_t *tsp_cpu_resume_main(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -163,7 +163,7 @@ extern void tsp_cpu_suspend_entry(uint64_t arg0,
uint64_t arg5,
uint64_t arg6,
uint64_t arg7);
extern tsp_args *tsp_cpu_suspend_main(uint64_t arg0,
extern tsp_args_t *tsp_cpu_suspend_main(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......@@ -179,7 +179,7 @@ extern void tsp_cpu_on_entry(uint64_t arg0,
uint64_t arg5,
uint64_t arg6,
uint64_t arg7);
extern tsp_args *tsp_cpu_on_main(void);
extern tsp_args_t *tsp_cpu_on_main(void);
extern void tsp_cpu_off_entry(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
......@@ -188,7 +188,7 @@ extern void tsp_cpu_off_entry(uint64_t arg0,
uint64_t arg5,
uint64_t arg6,
uint64_t arg7);
extern tsp_args *tsp_cpu_off_main(uint64_t arg0,
extern tsp_args_t *tsp_cpu_off_main(uint64_t arg0,
uint64_t arg1,
uint64_t arg2,
uint64_t arg3,
......
......@@ -64,16 +64,16 @@
* Structure used for telling the next BL how much of a particular type of
* memory is available for its use and how much is already used.
******************************************************************************/
typedef struct {
typedef struct meminfo {
unsigned long total_base;
long total_size;
unsigned long free_base;
long free_size;
unsigned long attr;
unsigned long next;
} meminfo;
} meminfo_t;
typedef struct {
typedef struct aapcs64_params {
unsigned long arg0;
unsigned long arg1;
unsigned long arg2;
......@@ -82,51 +82,51 @@ typedef struct {
unsigned long arg5;
unsigned long arg6;
unsigned long arg7;
} aapcs64_params;
} aapcs64_params_t;
/*******************************************************************************
* This structure represents the superset of information needed while switching
* exception levels. The only two mechanisms to do so are ERET & SMC. In case of
* SMC all members apart from 'aapcs64_params' will be ignored.
******************************************************************************/
typedef struct {
typedef struct el_change_info {
unsigned long entrypoint;
unsigned long spsr;
unsigned long security_state;
aapcs64_params args;
} el_change_info;
aapcs64_params_t args;
} el_change_info_t;
/*******************************************************************************
* This structure represents the superset of information that can be passed to
* BL31 e.g. while passing control to it from BL2. The BL32 parameters will be
* populated only if BL2 detects its presence.
******************************************************************************/
typedef struct {
meminfo bl31_meminfo;
el_change_info bl32_image_info;
meminfo bl32_meminfo;
el_change_info bl33_image_info;
meminfo bl33_meminfo;
} bl31_args;
typedef struct bl31_args {
meminfo_t bl31_meminfo;
el_change_info_t bl32_image_info;
meminfo_t bl32_meminfo;
el_change_info_t bl33_image_info;
meminfo_t bl33_meminfo;
} bl31_args_t;
/*******************************************************************************
* Function & variable prototypes
******************************************************************************/
extern unsigned long page_align(unsigned long, unsigned);
extern void change_security_state(unsigned int);
extern void __dead2 drop_el(aapcs64_params *, unsigned long, unsigned long);
extern void __dead2 raise_el(aapcs64_params *);
extern void __dead2 change_el(el_change_info *);
extern void __dead2 drop_el(aapcs64_params_t *, unsigned long, unsigned long);
extern void __dead2 raise_el(aapcs64_params_t *);
extern void __dead2 change_el(el_change_info_t *);
extern unsigned long make_spsr(unsigned long, unsigned long, unsigned long);
extern void init_bl2_mem_layout(meminfo *,
meminfo *,
extern void init_bl2_mem_layout(meminfo_t *,
meminfo_t *,
unsigned int,
unsigned long) __attribute__((weak));
extern void init_bl31_mem_layout(const meminfo *,
meminfo *,
extern void init_bl31_mem_layout(const meminfo_t *,
meminfo_t *,
unsigned int) __attribute__((weak));
extern unsigned long image_size(const char *);
extern unsigned long load_image(meminfo *,
extern unsigned long load_image(meminfo_t *,
const char *,
unsigned int,
unsigned long);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment