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
......@@ -50,17 +50,17 @@
#define UUID_NON_TRUSTED_FIRMWARE_BL33 \
{0xa7eed0d6, 0xeafc, 0x4bd5, 0x97, 0x82, {0x99, 0x34, 0xf2, 0x34, 0xb6, 0xe4} }
typedef struct {
typedef struct fip_toc_header {
uint32_t name;
uint32_t serial_number;
uint64_t flags;
} fip_toc_header;
} fip_toc_header_t;
typedef struct {
typedef struct fip_toc_entry {
uuid_t uuid;
uint64_t offset_address;
uint64_t size;
uint64_t flags;
} fip_toc_entry;
} fip_toc_entry_t;
#endif /* __FIRMWARE_IMAGE_PACKAGE_H__ */
......@@ -165,23 +165,23 @@
* TZC_ACTION_ERR_INT - Raise interrupt, raise exception -> sync
* external data abort
*/
enum tzc_action {
typedef enum {
TZC_ACTION_NONE = 0,
TZC_ACTION_ERR = 1,
TZC_ACTION_INT = 2,
TZC_ACTION_ERR_INT = (TZC_ACTION_ERR | TZC_ACTION_INT)
};
} tzc_action_t;
/*
* Controls secure access to a region. If not enabled secure access is not
* allowed to region.
*/
enum tzc_region_attributes {
typedef enum {
TZC_REGION_S_NONE = 0,
TZC_REGION_S_RD = 1,
TZC_REGION_S_WR = 2,
TZC_REGION_S_RDWR = (TZC_REGION_S_RD | TZC_REGION_S_WR)
};
} tzc_region_attributes_t;
/*
* Implementation defined values used to validate inputs later.
......@@ -189,22 +189,21 @@ enum tzc_region_attributes {
* Regions : max of 9 ; 0 to 8
* Address width : Values between 32 to 64
*/
struct tzc_instance {
typedef struct tzc_instance {
uint64_t base;
uint32_t aid_width;
uint8_t addr_width;
uint8_t num_filters;
uint8_t num_regions;
};
} tzc_instance_t ;
void tzc_init(struct tzc_instance *controller);
void tzc_configure_region(const struct tzc_instance *controller, uint32_t filters,
void tzc_init(tzc_instance_t *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, uint32_t ns_device_access);
void tzc_enable_filters(const struct tzc_instance *controller);
void tzc_disable_filters(const struct tzc_instance *controller);
void tzc_set_action(const struct tzc_instance *controller,
enum tzc_action action);
tzc_region_attributes_t sec_attr, uint32_t ns_device_access);
void tzc_enable_filters(const tzc_instance_t *controller);
void tzc_disable_filters(const tzc_instance_t *controller);
void tzc_set_action(const tzc_instance_t *controller, tzc_action_t action);
#endif /*__ASSEMBLY__*/
......
......@@ -36,58 +36,58 @@
/* Generic IO entity structure,representing an accessible IO construct on the
* device, such as a file */
struct io_entity {
typedef struct io_entity {
io_dev_handle dev_handle;
uintptr_t info;
};
} io_entity_t;
/* Device info structure, providing device-specific functions and a means of
* adding driver-specific state */
struct io_dev_info {
typedef struct io_dev_info {
struct io_dev_funcs *funcs;
uintptr_t info;
};
} io_dev_info_t;
/* Structure used to create a connection to a type of device */
struct io_dev_connector {
typedef struct io_dev_connector {
/* dev_open opens a connection to a particular device driver */
int (*dev_open)(void *spec, struct io_dev_info **dev_info);
};
int (*dev_open)(void *spec, io_dev_info_t **dev_info);
} io_dev_connector_t;
/* Structure to hold device driver function pointers */
struct io_dev_funcs {
io_type (*type)(void);
int (*open)(struct io_dev_info *dev_info, const void *spec,
struct io_entity *entity);
int (*seek)(struct io_entity *entity, int mode, ssize_t offset);
int (*size)(struct io_entity *entity, size_t *length);
int (*read)(struct io_entity *entity, void *buffer, size_t length,
typedef struct io_dev_funcs {
io_type_t (*type)(void);
int (*open)(io_dev_info_t *dev_info, const void *spec,
io_entity_t *entity);
int (*seek)(io_entity_t *entity, int mode, ssize_t offset);
int (*size)(io_entity_t *entity, size_t *length);
int (*read)(io_entity_t *entity, void *buffer, size_t length,
size_t *length_read);
int (*write)(struct io_entity *entity, const void *buffer,
int (*write)(io_entity_t *entity, const void *buffer,
size_t length, size_t *length_written);
int (*close)(struct io_entity *entity);
int (*dev_init)(struct io_dev_info *dev_info, const void *init_params);
int (*dev_close)(struct io_dev_info *dev_info);
};
int (*close)(io_entity_t *entity);
int (*dev_init)(io_dev_info_t *dev_info, const void *init_params);
int (*dev_close)(io_dev_info_t *dev_info);
} io_dev_funcs_t;
/* IO platform data - used to track devices registered for a specific
* platform */
struct io_plat_data {
struct io_dev_info *devices[MAX_IO_DEVICES];
typedef struct io_plat_data {
io_dev_info_t *devices[MAX_IO_DEVICES];
unsigned int dev_count;
};
} io_plat_data_t;
/* Operations intended to be performed during platform initialisation */
/* Initialise the IO layer */
void io_init(struct io_plat_data *data);
void io_init(io_plat_data_t *data);
/* Register a device driver */
int io_register_device(struct io_dev_info *dev_info);
int io_register_device(io_dev_info_t *dev_info);
#endif /* __IO_DRIVER_H__ */
......@@ -49,20 +49,20 @@ typedef enum {
MT_SECURE = 0 << 2,
MT_NS = 1 << 2
} mmap_attr;
} mmap_attr_t;
/*
* Structure for specifying a single region of memory.
*/
typedef struct {
typedef struct mmap_region {
unsigned long base;
unsigned long size;
mmap_attr attr;
} mmap_region;
mmap_attr_t attr;
} mmap_region_t;
extern void mmap_add_region(unsigned long base, unsigned long size,
unsigned attr);
extern void mmap_add(const mmap_region *mm);
extern void mmap_add(const mmap_region_t *mm);
extern void init_xlat_tables(void);
......
......@@ -36,18 +36,18 @@
#define BAKERY_LOCK_MAX_CPUS PLATFORM_CORE_COUNT
#ifndef __ASSEMBLY__
typedef struct {
typedef struct bakery_lock {
int owner;
volatile char entering[BAKERY_LOCK_MAX_CPUS];
volatile unsigned number[BAKERY_LOCK_MAX_CPUS];
} bakery_lock;
} bakery_lock_t;
#define NO_OWNER (-1)
void bakery_lock_init(bakery_lock *bakery);
void bakery_lock_get(unsigned long mpidr, bakery_lock *bakery);
void bakery_lock_release(unsigned long mpidr, bakery_lock *bakery);
int bakery_lock_try(unsigned long mpidr, bakery_lock *bakery);
void bakery_lock_init(bakery_lock_t *bakery);
void bakery_lock_get(unsigned long mpidr, bakery_lock_t *bakery);
void bakery_lock_release(unsigned long mpidr, bakery_lock_t *bakery);
int bakery_lock_try(unsigned long mpidr, bakery_lock_t *bakery);
#endif /*__ASSEMBLY__*/
#endif /* __BAKERY_LOCK_H__ */
......@@ -45,7 +45,7 @@ typedef enum {
IO_TYPE_MEMMAP,
IO_TYPE_FIRMWARE_IMAGE_PACKAGE,
IO_TYPE_MAX
} io_type;
} io_type_t;
/* Modes used when seeking data on a supported device */
......@@ -55,7 +55,7 @@ typedef enum {
IO_SEEK_END,
IO_SEEK_CUR,
IO_SEEK_MAX
} io_seek_mode;
} io_seek_mode_t;
/* Connector type, providing a means of identifying a device to open */
......@@ -71,18 +71,18 @@ typedef struct io_entity *io_handle;
/* File specification - used to refer to data on a device supporting file-like
* entities */
typedef struct {
typedef struct io_file_spec {
const char *path;
unsigned int mode;
} io_file_spec;
} io_file_spec_t;
/* Block specification - used to refer to data on a device supporting
* block-like entities */
typedef struct {
typedef struct io_block_spec {
unsigned long offset;
size_t length;
} io_block_spec;
} io_block_spec_t;
/* Access modes used when accessing data on a device */
......@@ -116,7 +116,7 @@ int io_dev_close(io_dev_handle dev_handle);
/* Synchronous operations */
int io_open(io_dev_handle dev_handle, const void *spec, io_handle *handle);
int io_seek(io_handle handle, io_seek_mode mode, ssize_t offset);
int io_seek(io_handle handle, io_seek_mode_t mode, ssize_t offset);
int io_size(io_handle handle, size_t *length);
......
......@@ -31,7 +31,7 @@
#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__
typedef struct {
typedef struct spinlock {
volatile unsigned int lock;
} spinlock_t;
......
......@@ -61,14 +61,14 @@ static unsigned next_xlat;
* Array of all memory regions stored in order of ascending base address.
* The list is terminated by the first entry with size == 0.
*/
static mmap_region mmap[MAX_MMAP_REGIONS + 1];
static mmap_region_t mmap[MAX_MMAP_REGIONS + 1];
static void print_mmap(void)
{
#if DEBUG_XLAT_TABLE
debug_print("mmap:\n");
mmap_region *mm = mmap;
mmap_region_t *mm = mmap;
while (mm->size) {
debug_print(" %010lx %10lx %x\n", mm->base, mm->size, mm->attr);
++mm;
......@@ -79,8 +79,8 @@ static void print_mmap(void)
void mmap_add_region(unsigned long base, unsigned long size, unsigned attr)
{
mmap_region *mm = mmap;
mmap_region *mm_last = mm + sizeof(mmap) / sizeof(mmap[0]) - 1;
mmap_region_t *mm = mmap;
mmap_region_t *mm_last = mm + sizeof(mmap) / sizeof(mmap[0]) - 1;
assert(IS_PAGE_ALIGNED(base));
assert(IS_PAGE_ALIGNED(size));
......@@ -103,7 +103,7 @@ void mmap_add_region(unsigned long base, unsigned long size, unsigned attr)
mm->attr = attr;
}
void mmap_add(const mmap_region *mm)
void mmap_add(const mmap_region_t *mm)
{
while (mm->size) {
mmap_add_region(mm->base, mm->size, mm->attr);
......@@ -140,7 +140,7 @@ static unsigned long mmap_desc(unsigned attr, unsigned long addr,
return desc;
}
static int mmap_region_attr(mmap_region *mm, unsigned long base,
static int mmap_region_attr(mmap_region_t *mm, unsigned long base,
unsigned long size)
{
int attr = mm->attr;
......@@ -167,7 +167,7 @@ static int mmap_region_attr(mmap_region *mm, unsigned long base,
}
}
static mmap_region *init_xlation_table(mmap_region *mm, unsigned long base,
static mmap_region_t *init_xlation_table(mmap_region_t *mm, unsigned long base,
unsigned long *table, unsigned level)
{
unsigned level_size_shift = L1_XLAT_ADDRESS_SHIFT - (level - 1) *
......
......@@ -40,24 +40,24 @@
/* Storage for a fixed maximum number of IO entities, definable by platform */
static struct io_entity entity_pool[MAX_IO_HANDLES];
static io_entity_t entity_pool[MAX_IO_HANDLES];
/* Simple way of tracking used storage - each entry is NULL or a pointer to an
* entity */
static struct io_entity *entity_map[MAX_IO_HANDLES];
static io_entity_t *entity_map[MAX_IO_HANDLES];
/* Track number of allocated entities */
static unsigned int entity_count;
/* Used to keep a reference to platform-specific data */
static struct io_plat_data *platform_data;
static io_plat_data_t *platform_data;
#if DEBUG /* Extra validation functions only used in debug builds */
/* Return a boolean value indicating whether a device connector is valid */
static int is_valid_dev_connector(const struct io_dev_connector *dev_con)
static int is_valid_dev_connector(const io_dev_connector_t *dev_con)
{
int result = (dev_con != NULL) && (dev_con->dev_open != NULL);
return result;
......@@ -67,7 +67,7 @@ static int is_valid_dev_connector(const struct io_dev_connector *dev_con)
/* Return a boolean value indicating whether a device handle is valid */
static int is_valid_dev(io_dev_handle handle)
{
const struct io_dev_info *dev = handle;
const io_dev_info_t *dev = handle;
int result = (dev != NULL) && (dev->funcs != NULL) &&
(dev->funcs->type != NULL) &&
(dev->funcs->type() < IO_TYPE_MAX);
......@@ -78,14 +78,14 @@ static int is_valid_dev(io_dev_handle handle)
/* Return a boolean value indicating whether an IO entity is valid */
static int is_valid_entity(io_handle handle)
{
const struct io_entity *entity = handle;
const io_entity_t *entity = handle;
int result = (entity != NULL) && (is_valid_dev(entity->dev_handle));
return result;
}
/* Return a boolean value indicating whether a seek mode is valid */
static int is_valid_seek_mode(io_seek_mode mode)
static int is_valid_seek_mode(io_seek_mode_t mode)
{
return ((mode != IO_SEEK_INVALID) && (mode < IO_SEEK_MAX));
}
......@@ -94,8 +94,8 @@ static int is_valid_seek_mode(io_seek_mode mode)
/* Open a connection to a specific device */
static int dev_open(const struct io_dev_connector *dev_con, void *dev_spec,
struct io_dev_info **dev_info)
static int dev_open(const io_dev_connector_t *dev_con, void *dev_spec,
io_dev_info_t **dev_info)
{
int result = IO_FAIL;
assert(dev_info != NULL);
......@@ -107,7 +107,7 @@ static int dev_open(const struct io_dev_connector *dev_con, void *dev_spec,
/* Set a handle to track an entity */
static void set_handle(io_handle *handle, struct io_entity *entity)
static void set_handle(io_handle *handle, io_entity_t *entity)
{
assert(handle != NULL);
*handle = entity;
......@@ -217,7 +217,7 @@ int io_dev_init(struct io_dev_info *dev_handle, const void *init_params)
assert(dev_handle != NULL);
assert(is_valid_dev(dev_handle));
struct io_dev_info *dev = dev_handle;
io_dev_info_t *dev = dev_handle;
if (dev->funcs->dev_init != NULL) {
result = dev->funcs->dev_init(dev, init_params);
......@@ -238,7 +238,7 @@ int io_dev_close(io_dev_handle dev_handle)
assert(dev_handle != NULL);
assert(is_valid_dev(dev_handle));
struct io_dev_info *dev = dev_handle;
io_dev_info_t *dev = dev_handle;
if (dev->funcs->dev_close != NULL) {
result = dev->funcs->dev_close(dev);
......@@ -261,8 +261,8 @@ int io_open(io_dev_handle dev_handle, const void *spec, io_handle *handle)
assert((spec != NULL) && (handle != NULL));
assert(is_valid_dev(dev_handle));
struct io_dev_info *dev = dev_handle;
struct io_entity *entity;
io_dev_info_t *dev = dev_handle;
io_entity_t *entity;
result = allocate_entity(&entity);
......@@ -281,14 +281,14 @@ int io_open(io_dev_handle dev_handle, const void *spec, io_handle *handle)
/* Seek to a specific position in an IO entity */
int io_seek(io_handle handle, io_seek_mode mode, ssize_t offset)
int io_seek(io_handle handle, io_seek_mode_t mode, ssize_t offset)
{
int result = IO_FAIL;
assert(is_valid_entity(handle) && is_valid_seek_mode(mode));
struct io_entity *entity = handle;
io_entity_t *entity = handle;
struct io_dev_info *dev = entity->dev_handle;
io_dev_info_t *dev = entity->dev_handle;
if (dev->funcs->seek != NULL)
result = dev->funcs->seek(entity, mode, offset);
......@@ -305,9 +305,9 @@ int io_size(io_handle handle, size_t *length)
int result = IO_FAIL;
assert(is_valid_entity(handle) && (length != NULL));
struct io_entity *entity = handle;
io_entity_t *entity = handle;
struct io_dev_info *dev = entity->dev_handle;
io_dev_info_t *dev = entity->dev_handle;
if (dev->funcs->size != NULL)
result = dev->funcs->size(entity, length);
......@@ -324,9 +324,9 @@ int io_read(io_handle handle, void *buffer, size_t length, size_t *length_read)
int result = IO_FAIL;
assert(is_valid_entity(handle) && (buffer != NULL));
struct io_entity *entity = handle;
io_entity_t *entity = handle;
struct io_dev_info *dev = entity->dev_handle;
io_dev_info_t *dev = entity->dev_handle;
if (dev->funcs->read != NULL)
result = dev->funcs->read(entity, buffer, length, length_read);
......@@ -344,9 +344,9 @@ int io_write(io_handle handle, const void *buffer, size_t length,
int result = IO_FAIL;
assert(is_valid_entity(handle) && (buffer != NULL));
struct io_entity *entity = handle;
io_entity_t *entity = handle;
struct io_dev_info *dev = entity->dev_handle;
io_dev_info_t *dev = entity->dev_handle;
if (dev->funcs->write != NULL) {
result = dev->funcs->write(entity, buffer, length,
......@@ -364,9 +364,9 @@ int io_close(io_handle handle)
int result = IO_FAIL;
assert(is_valid_entity(handle));
struct io_entity *entity = handle;
io_entity_t *entity = handle;
struct io_dev_info *dev = entity->dev_handle;
io_dev_info_t *dev = entity->dev_handle;
if (dev->funcs->close != NULL)
result = dev->funcs->close(entity);
......
......@@ -66,7 +66,7 @@
/* Initialize Bakery Lock to reset ownership and all ticket values */
void bakery_lock_init(bakery_lock *bakery)
void bakery_lock_init(bakery_lock_t *bakery)
{
assert(bakery);
......@@ -77,7 +77,7 @@ void bakery_lock_init(bakery_lock *bakery)
/* Obtain a ticket for a given CPU */
static unsigned int bakery_get_ticket(bakery_lock *bakery, unsigned int me)
static unsigned int bakery_get_ticket(bakery_lock_t *bakery, unsigned int me)
{
unsigned int my_ticket, their_ticket;
unsigned int they;
......@@ -124,7 +124,7 @@ static unsigned int bakery_get_ticket(bakery_lock *bakery, unsigned int me)
* of others'. The CPU with the highest priority (lowest numerical value)
* acquires the lock
*/
void bakery_lock_get(unsigned long mpidr, bakery_lock *bakery)
void bakery_lock_get(unsigned long mpidr, bakery_lock_t *bakery)
{
unsigned int they, me;
unsigned int my_ticket, my_prio, their_ticket;
......@@ -176,7 +176,7 @@ void bakery_lock_get(unsigned long mpidr, bakery_lock *bakery)
/* Release the lock and signal contenders */
void bakery_lock_release(unsigned long mpidr, bakery_lock *bakery)
void bakery_lock_release(unsigned long mpidr, bakery_lock_t *bakery)
{
unsigned int me = platform_get_core_pos(mpidr);
......
......@@ -45,23 +45,23 @@ typedef struct {
const char *file_name;
unsigned long mode;
size_t name_length;
} smh_file_open_block;
} smh_file_open_block_t;
typedef struct {
long handle;
void *buffer;
size_t length;
} smh_file_read_write_block;
} smh_file_read_write_block_t;
typedef struct {
long handle;
ssize_t location;
} smh_file_seek_block;
} smh_file_seek_block_t;
typedef struct {
char *command_line;
size_t command_length;
} smh_system_block;
} smh_system_block_t;
long semihosting_connection_supported(void)
{
......@@ -70,7 +70,7 @@ long semihosting_connection_supported(void)
long semihosting_file_open(const char *file_name, size_t mode)
{
smh_file_open_block open_block;
smh_file_open_block_t open_block;
open_block.file_name = file_name;
open_block.mode = mode;
......@@ -82,7 +82,7 @@ long semihosting_file_open(const char *file_name, size_t mode)
long semihosting_file_seek(long file_handle, ssize_t offset)
{
smh_file_seek_block seek_block;
smh_file_seek_block_t seek_block;
long result;
seek_block.handle = file_handle;
......@@ -99,7 +99,7 @@ long semihosting_file_seek(long file_handle, ssize_t offset)
long semihosting_file_read(long file_handle, size_t *length, void *buffer)
{
smh_file_read_write_block read_block;
smh_file_read_write_block_t read_block;
long result = -EINVAL;
if ((length == NULL) || (buffer == NULL))
......@@ -125,7 +125,7 @@ long semihosting_file_write(long file_handle,
size_t *length,
const void *buffer)
{
smh_file_read_write_block write_block;
smh_file_read_write_block_t write_block;
if ((length == NULL) || (buffer == NULL))
return -EINVAL;
......@@ -169,7 +169,7 @@ void semihosting_write_string(char *string)
long semihosting_system(char *command_line)
{
smh_system_block system_block;
smh_system_block_t system_block;
system_block.command_line = command_line;
system_block.command_length = strlen(command_line);
......
......@@ -122,7 +122,7 @@ void disable_mmu(void)
* This doesn't include TZRAM as the 'mem_layout' argument passed to to
* configure_mmu() will give the available subset of that,
*/
const mmap_region fvp_mmap[] = {
const mmap_region_t fvp_mmap[] = {
{ TZROM_BASE, TZROM_SIZE, MT_MEMORY | MT_RO | MT_SECURE },
{ TZDRAM_BASE, TZDRAM_SIZE, MT_MEMORY | MT_RW | MT_SECURE },
{ FLASH0_BASE, FLASH0_SIZE, MT_MEMORY | MT_RO | MT_SECURE },
......@@ -140,7 +140,7 @@ const mmap_region fvp_mmap[] = {
/*******************************************************************************
* Setup the pagetables as per the platform memory map & initialize the mmu
*******************************************************************************/
void configure_mmu(meminfo *mem_layout,
void configure_mmu(meminfo_t *mem_layout,
unsigned long ro_start,
unsigned long ro_limit,
unsigned long coh_start,
......
......@@ -60,9 +60,9 @@ extern unsigned long __BL1_RAM_END__;
/* Data structure which holds the extents of the trusted SRAM for BL1*/
static meminfo bl1_tzram_layout;
static meminfo_t bl1_tzram_layout;
meminfo *bl1_plat_sec_mem_layout(void)
meminfo_t *bl1_plat_sec_mem_layout(void)
{
return &bl1_tzram_layout;
}
......
......@@ -68,7 +68,7 @@ extern unsigned long __COHERENT_RAM_END__;
extern unsigned char **bl2_el_change_mem_ptr;
/* Data structure which holds the extents of the trusted SRAM for BL2 */
static meminfo bl2_tzram_layout
static meminfo_t bl2_tzram_layout
__attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
section("tzfw_coherent_mem")));
......@@ -76,9 +76,9 @@ __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
* Reference to structure which holds the arguments which need to be passed
* to BL31
******************************************************************************/
static bl31_args *bl2_to_bl31_args;
static bl31_args_t *bl2_to_bl31_args;
meminfo *bl2_plat_sec_mem_layout(void)
meminfo_t *bl2_plat_sec_mem_layout(void)
{
return &bl2_tzram_layout;
}
......@@ -87,7 +87,7 @@ meminfo *bl2_plat_sec_mem_layout(void)
* This function returns a pointer to the memory that the platform has kept
* aside to pass all the information that BL31 could need.
******************************************************************************/
bl31_args *bl2_get_bl31_args_ptr(void)
bl31_args_t *bl2_get_bl31_args_ptr(void)
{
return bl2_to_bl31_args;
}
......@@ -97,7 +97,7 @@ bl31_args *bl2_get_bl31_args_ptr(void)
* in x0. This memory layout is sitting at the base of the free trusted SRAM.
* Copy it to a safe loaction before its reclaimed by later BL2 functionality.
******************************************************************************/
void bl2_early_platform_setup(meminfo *mem_layout,
void bl2_early_platform_setup(meminfo_t *mem_layout,
void *data)
{
/* Setup the BL2 memory layout */
......@@ -137,10 +137,10 @@ void bl2_platform_setup()
* Ensure that the secure DRAM memory used for passing BL31 arguments
* does not overlap with the BL32_BASE.
*/
assert (BL32_BASE > TZDRAM_BASE + sizeof(bl31_args));
assert (BL32_BASE > TZDRAM_BASE + sizeof(bl31_args_t));
/* Use the Trusted DRAM for passing args to BL31 */
bl2_to_bl31_args = (bl31_args *) TZDRAM_BASE;
bl2_to_bl31_args = (bl31_args_t *) TZDRAM_BASE;
/* Populate the extents of memory available for loading BL33 */
bl2_to_bl31_args->bl33_meminfo.total_base = DRAM_BASE;
......
......@@ -66,14 +66,14 @@ extern unsigned long __COHERENT_RAM_END__;
* Reference to structure which holds the arguments that have been passed to
* BL31 from BL2.
******************************************************************************/
static bl31_args *bl2_to_bl31_args;
static bl31_args_t *bl2_to_bl31_args;
meminfo *bl31_plat_sec_mem_layout(void)
meminfo_t *bl31_plat_sec_mem_layout(void)
{
return &bl2_to_bl31_args->bl31_meminfo;
}
meminfo *bl31_plat_get_bl32_mem_layout(void)
meminfo_t *bl31_plat_get_bl32_mem_layout(void)
{
return &bl2_to_bl31_args->bl32_meminfo;
}
......@@ -84,9 +84,9 @@ meminfo *bl31_plat_get_bl32_mem_layout(void)
* while BL32 corresponds to the secure image type. A NULL pointer is returned
* if the image does not exist.
******************************************************************************/
el_change_info *bl31_get_next_image_info(uint32_t type)
el_change_info_t *bl31_get_next_image_info(uint32_t type)
{
el_change_info *next_image_info;
el_change_info_t *next_image_info;
next_image_info = (type == NON_SECURE) ?
&bl2_to_bl31_args->bl33_image_info :
......@@ -110,7 +110,7 @@ el_change_info *bl31_get_next_image_info(uint32_t type)
* has flushed this information to memory, so we are guaranteed to pick up good
* data
******************************************************************************/
void bl31_early_platform_setup(bl31_args *from_bl2,
void bl31_early_platform_setup(bl31_args_t *from_bl2,
void *data)
{
bl2_to_bl31_args = from_bl2;
......
......@@ -66,11 +66,11 @@ extern unsigned long __COHERENT_RAM_END__;
#define BL32_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
/* Data structure which holds the extents of the trusted SRAM for BL32 */
static meminfo bl32_tzdram_layout
static meminfo_t bl32_tzdram_layout
__attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE),
section("tzfw_coherent_mem")));
meminfo *bl32_plat_sec_mem_layout(void)
meminfo_t *bl32_plat_sec_mem_layout(void)
{
return &bl32_tzdram_layout;
}
......@@ -79,7 +79,7 @@ meminfo *bl32_plat_sec_mem_layout(void)
* BL1 has passed the extents of the trusted SRAM that's at BL32's disposal.
* Initialize the BL32 data structure with the memory extends
******************************************************************************/
void bl32_early_platform_setup(meminfo *mem_layout,
void bl32_early_platform_setup(meminfo_t *mem_layout,
void *data)
{
/* Setup the BL32 memory layout */
......
......@@ -41,7 +41,7 @@
* TODO: Someday there will be a generic power controller api. At the moment
* each platform has its own pwrc so just exporting functions is fine.
*/
static bakery_lock pwrc_lock __attribute__ ((section("tzfw_coherent_mem")));
static bakery_lock_t pwrc_lock __attribute__ ((section("tzfw_coherent_mem")));
unsigned int fvp_pwrc_get_cpu_wkr(unsigned long mpidr)
{
......
......@@ -40,40 +40,40 @@
#include <debug.h>
/* IO devices */
static struct io_plat_data io_data;
static struct io_dev_connector *sh_dev_con;
static io_plat_data_t io_data;
static io_dev_connector_t *sh_dev_con;
static void *const sh_dev_spec;
static void *const sh_init_params;
static io_dev_handle sh_dev_handle;
static struct io_dev_connector *fip_dev_con;
static io_dev_connector_t *fip_dev_con;
static void *const fip_dev_spec;
static io_dev_handle fip_dev_handle;
static struct io_dev_connector *memmap_dev_con;
static io_dev_connector_t *memmap_dev_con;
static void *const memmap_dev_spec;
static void *const memmap_init_params;
static io_dev_handle memmap_dev_handle;
static io_block_spec fip_block_spec = {
static io_block_spec_t fip_block_spec = {
.offset = FLASH0_BASE,
.length = FLASH0_SIZE
};
static io_file_spec bl2_file_spec = {
static io_file_spec_t bl2_file_spec = {
.path = BL2_IMAGE_NAME,
.mode = FOPEN_MODE_RB
};
static io_file_spec bl31_file_spec = {
static io_file_spec_t bl31_file_spec = {
.path = BL31_IMAGE_NAME,
.mode = FOPEN_MODE_RB
};
static io_file_spec bl32_file_spec = {
static io_file_spec_t bl32_file_spec = {
.path = BL32_IMAGE_NAME,
.mode = FOPEN_MODE_RB
};
static io_file_spec bl33_file_spec = {
static io_file_spec_t bl33_file_spec = {
.path = BL33_IMAGE_NAME,
.mode = FOPEN_MODE_RB
};
......@@ -194,7 +194,7 @@ int plat_get_image_source(const char *image_name, io_dev_handle *dev_handle,
if (strcmp(policy->image_name, image_name) == 0) {
result = policy->check(policy->image_spec);
if (result == IO_SUCCESS) {
*(io_file_spec **)image_spec =
*(io_file_spec_t **)image_spec =
policy->image_spec;
*dev_handle = *(policy->dev_handle);
break;
......@@ -203,7 +203,7 @@ int plat_get_image_source(const char *image_name, io_dev_handle *dev_handle,
policy->image_spec);
if (result == IO_SUCCESS) {
*dev_handle = sh_dev_handle;
*(io_file_spec **)image_spec =
*(io_file_spec_t **)image_spec =
policy->image_spec;
}
}
......
......@@ -78,7 +78,7 @@ int fvp_affinst_on(unsigned long mpidr,
{
int rc = PSCI_E_SUCCESS;
unsigned long linear_id;
mailbox *fvp_mboxes;
mailbox_t *fvp_mboxes;
unsigned int psysr;
/*
......@@ -100,7 +100,7 @@ int fvp_affinst_on(unsigned long mpidr,
} while (psysr & PSYSR_AFF_L0);
linear_id = platform_get_core_pos(mpidr);
fvp_mboxes = (mailbox *) (TZDRAM_BASE + MBOX_OFF);
fvp_mboxes = (mailbox_t *) (TZDRAM_BASE + MBOX_OFF);
fvp_mboxes[linear_id].value = sec_entrypoint;
flush_dcache_range((unsigned long) &fvp_mboxes[linear_id],
sizeof(unsigned long));
......@@ -209,7 +209,7 @@ int fvp_affinst_suspend(unsigned long mpidr,
int rc = PSCI_E_SUCCESS;
unsigned int gicc_base, ectlr;
unsigned long cpu_setup, cci_setup, linear_id;
mailbox *fvp_mboxes;
mailbox_t *fvp_mboxes;
switch (afflvl) {
case MPIDR_AFFLVL1:
......@@ -247,7 +247,7 @@ int fvp_affinst_suspend(unsigned long mpidr,
/* Program the jump address for the target cpu */
linear_id = platform_get_core_pos(mpidr);
fvp_mboxes = (mailbox *) (TZDRAM_BASE + MBOX_OFF);
fvp_mboxes = (mailbox_t *) (TZDRAM_BASE + MBOX_OFF);
fvp_mboxes[linear_id].value = sec_entrypoint;
flush_dcache_range((unsigned long) &fvp_mboxes[linear_id],
sizeof(unsigned long));
......@@ -288,7 +288,7 @@ int fvp_affinst_on_finish(unsigned long mpidr,
{
int rc = PSCI_E_SUCCESS;
unsigned long linear_id, cpu_setup, cci_setup;
mailbox *fvp_mboxes;
mailbox_t *fvp_mboxes;
unsigned int gicd_base, gicc_base, reg_val, ectlr;
switch (afflvl) {
......@@ -341,7 +341,7 @@ int fvp_affinst_on_finish(unsigned long mpidr,
fvp_pwrc_clr_wen(mpidr);
/* Zero the jump address in the mailbox for this cpu */
fvp_mboxes = (mailbox *) (TZDRAM_BASE + MBOX_OFF);
fvp_mboxes = (mailbox_t *) (TZDRAM_BASE + MBOX_OFF);
linear_id = platform_get_core_pos(mpidr);
fvp_mboxes[linear_id].value = 0;
flush_dcache_range((unsigned long) &fvp_mboxes[linear_id],
......@@ -394,7 +394,7 @@ int fvp_affinst_suspend_finish(unsigned long mpidr,
/*******************************************************************************
* Export the platform handlers to enable psci to invoke them
******************************************************************************/
static plat_pm_ops fvp_plat_pm_ops = {
static plat_pm_ops_t fvp_plat_pm_ops = {
fvp_affinst_standby,
fvp_affinst_on,
fvp_affinst_off,
......@@ -406,7 +406,7 @@ static plat_pm_ops fvp_plat_pm_ops = {
/*******************************************************************************
* Export the platform specific power ops & initialize the fvp power controller
******************************************************************************/
int platform_setup_pm(plat_pm_ops **plat_ops)
int platform_setup_pm(plat_pm_ops_t **plat_ops)
{
*plat_ops = &fvp_plat_pm_ops;
return 0;
......
......@@ -44,7 +44,7 @@
*/
void plat_security_setup(void)
{
struct tzc_instance controller;
tzc_instance_t controller;
/*
* The Base FVP has a TrustZone address space controller, the Foundation
......
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