aboutsummaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorDan Handley <dan.handley@arm.com>2014-04-10 15:37:22 +0100
committerDan Handley <dan.handley@arm.com>2014-05-06 13:57:48 +0100
commitfb037bfb7cbf7b404c069b4ebac5a10059d948b1 (patch)
tree7039b044f48574085b3d3c6a2e7c20d41a87da20 /bl31
parentc5945735a9705675201d2799654348425f28f551 (diff)
downloadarm-trusted-firmware-fb037bfb7cbf7b404c069b4ebac5a10059d948b1.tar.gz
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
Diffstat (limited to 'bl31')
-rw-r--r--bl31/bl31_main.c6
-rw-r--r--bl31/context_mgmt.c26
-rw-r--r--bl31/runtime_svc.c10
3 files changed, 21 insertions, 21 deletions
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 536bb86..907c487 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -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;
}
diff --git a/bl31/context_mgmt.c b/bl31/context_mgmt.c
index 60c3492..09b3bb8 100644
--- a/bl31/context_mgmt.c
+++ b/bl31/context_mgmt.c
@@ -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);
diff --git a/bl31/runtime_svc.c b/bl31/runtime_svc.c
index 1628e8d..8ec2f0b 100644
--- a/bl31/runtime_svc.c
+++ b/bl31/runtime_svc.c
@@ -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();