summaryrefslogtreecommitdiff
path: root/lib/semihosting
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 /lib/semihosting
parentc5945735a9705675201d2799654348425f28f551 (diff)
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 'lib/semihosting')
-rw-r--r--lib/semihosting/semihosting.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/semihosting/semihosting.c b/lib/semihosting/semihosting.c
index d5b8524b..3232cd54 100644
--- a/lib/semihosting/semihosting.c
+++ b/lib/semihosting/semihosting.c
@@ -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);