summaryrefslogtreecommitdiff
path: root/include/lib
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 /include/lib
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 'include/lib')
-rw-r--r--include/lib/aarch64/xlat_tables.h10
-rw-r--r--include/lib/bakery_lock.h12
-rw-r--r--include/lib/io_storage.h14
-rw-r--r--include/lib/spinlock.h2
4 files changed, 19 insertions, 19 deletions
diff --git a/include/lib/aarch64/xlat_tables.h b/include/lib/aarch64/xlat_tables.h
index 01b1afe..d7e1c60 100644
--- a/include/lib/aarch64/xlat_tables.h
+++ b/include/lib/aarch64/xlat_tables.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);
diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h
index 6e6e966..0def067 100644
--- a/include/lib/bakery_lock.h
+++ b/include/lib/bakery_lock.h
@@ -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__ */
diff --git a/include/lib/io_storage.h b/include/lib/io_storage.h
index 04e63c3..59fd3f4 100644
--- a/include/lib/io_storage.h
+++ b/include/lib/io_storage.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);
diff --git a/include/lib/spinlock.h b/include/lib/spinlock.h
index 94aaa1a..cb0bc3e 100644
--- a/include/lib/spinlock.h
+++ b/include/lib/spinlock.h
@@ -31,7 +31,7 @@
#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__
-typedef struct {
+typedef struct spinlock {
volatile unsigned int lock;
} spinlock_t;