diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/arm/tzc400/tzc400.c | 14 | ||||
-rw-r--r-- | drivers/io/io_fip.c | 60 | ||||
-rw-r--r-- | drivers/io/io_memmap.c | 52 | ||||
-rw-r--r-- | drivers/io/io_semihosting.c | 38 |
4 files changed, 82 insertions, 82 deletions
diff --git a/drivers/arm/tzc400/tzc400.c b/drivers/arm/tzc400/tzc400.c index ec6adee..56c6dea 100644 --- a/drivers/arm/tzc400/tzc400.c +++ b/drivers/arm/tzc400/tzc400.c @@ -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; diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c index 3a5d220..482e068 100644 --- a/drivers/io/io_fip.c +++ b/drivers/io/io_fip.c @@ -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); diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c index 5685be1..2e70e96 100644 --- a/drivers/io/io_memmap.c +++ b/drivers/io/io_memmap.c @@ -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); diff --git a/drivers/io/io_semihosting.c b/drivers/io/io_semihosting.c index c8013bc..89c844b 100644 --- a/drivers/io/io_semihosting.c +++ b/drivers/io/io_semihosting.c @@ -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); |