diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bl1/bl1.h | 2 | ||||
-rw-r--r-- | include/bl2/bl2.h | 4 | ||||
-rw-r--r-- | include/bl31/bl31.h | 8 | ||||
-rw-r--r-- | include/bl31/context.h | 46 | ||||
-rw-r--r-- | include/bl31/runtime_svc.h | 20 | ||||
-rw-r--r-- | include/bl31/services/psci.h | 10 | ||||
-rw-r--r-- | include/bl32/bl32.h | 2 | ||||
-rw-r--r-- | include/bl32/payloads/tsp.h | 34 | ||||
-rw-r--r-- | include/common/bl_common.h | 44 | ||||
-rw-r--r-- | include/common/firmware_image_package.h | 8 | ||||
-rw-r--r-- | include/drivers/arm/tzc400.h | 25 | ||||
-rw-r--r-- | include/drivers/io_driver.h | 48 | ||||
-rw-r--r-- | include/lib/aarch64/xlat_tables.h | 10 | ||||
-rw-r--r-- | include/lib/bakery_lock.h | 12 | ||||
-rw-r--r-- | include/lib/io_storage.h | 14 | ||||
-rw-r--r-- | include/lib/spinlock.h | 2 |
16 files changed, 144 insertions, 145 deletions
diff --git a/include/bl1/bl1.h b/include/bl1/bl1.h index e1d50c0f7..1750a1f05 100644 --- a/include/bl1/bl1.h +++ b/include/bl1/bl1.h @@ -39,7 +39,7 @@ * Function prototypes *****************************************/ extern void bl1_platform_setup(void); -extern meminfo *bl1_plat_sec_mem_layout(void); +extern meminfo_t *bl1_plat_sec_mem_layout(void); #endif /*__ASSEMBLY__*/ diff --git a/include/bl2/bl2.h b/include/bl2/bl2.h index d0ff69bbc..9a5094ff9 100644 --- a/include/bl2/bl2.h +++ b/include/bl2/bl2.h @@ -42,7 +42,7 @@ extern unsigned long long bl2_entrypoint; * Function prototypes *****************************************/ extern void bl2_platform_setup(void); -extern meminfo *bl2_plat_sec_mem_layout(void); -extern bl31_args *bl2_get_bl31_args_ptr(void); +extern meminfo_t *bl2_plat_sec_mem_layout(void); +extern bl31_args_t *bl2_get_bl31_args_ptr(void); #endif /* __BL2_H__ */ diff --git a/include/bl31/bl31.h b/include/bl31/bl31.h index a5539d924..6dd759640 100644 --- a/include/bl31/bl31.h +++ b/include/bl31/bl31.h @@ -46,9 +46,9 @@ extern void bl31_next_el_arch_setup(uint32_t security_state); extern void bl31_set_next_image_type(uint32_t type); extern uint32_t bl31_get_next_image_type(void); extern void bl31_prepare_next_image_entry(); -extern el_change_info *bl31_get_next_image_info(uint32_t type); +extern el_change_info_t *bl31_get_next_image_info(uint32_t type); extern void bl31_platform_setup(void); -extern meminfo *bl31_plat_get_bl32_mem_layout(void); -extern meminfo *bl31_plat_sec_mem_layout(void); -extern void bl31_register_bl32_init(int32_t (*)(meminfo *)); +extern meminfo_t *bl31_plat_get_bl32_mem_layout(void); +extern meminfo_t *bl31_plat_sec_mem_layout(void); +extern void bl31_register_bl32_init(int32_t (*)(meminfo_t *)); #endif /* __BL31_H__ */ diff --git a/include/bl31/context.h b/include/bl31/context.h index b0c98102e..c7eda7df0 100644 --- a/include/bl31/context.h +++ b/include/bl31/context.h @@ -177,9 +177,9 @@ */ #define DWORD_SHIFT 3 #define DEFINE_REG_STRUCT(name, num_regs) \ - typedef struct { \ + typedef struct name { \ uint64_t _regs[num_regs]; \ - } __aligned(16) name + } __aligned(16) name##_t /* Constants to determine the size of individual context structures */ #define CTX_GPREG_ALL (CTX_GPREGS_END >> DWORD_SHIFT) @@ -232,31 +232,31 @@ DEFINE_REG_STRUCT(el3_state, CTX_EL3STATE_ALL); * structure at exception entry and exit. Each instance will * correspond to either the secure or the non-secure state. */ -typedef struct { - gp_regs gpregs_ctx; - el3_state el3state_ctx; - el1_sys_regs sysregs_ctx; - fp_regs fpregs_ctx; -} cpu_context; +typedef struct cpu_context { + gp_regs_t gpregs_ctx; + el3_state_t el3state_ctx; + el1_sys_regs_t sysregs_ctx; + fp_regs_t fpregs_ctx; +} cpu_context_t; -/* Macros to access members of the 'cpu_context' structure */ -#define get_el3state_ctx(h) (&((cpu_context *) h)->el3state_ctx) -#define get_fpregs_ctx(h) (&((cpu_context *) h)->fpregs_ctx) -#define get_sysregs_ctx(h) (&((cpu_context *) h)->sysregs_ctx) -#define get_gpregs_ctx(h) (&((cpu_context *) h)->gpregs_ctx) +/* Macros to access members of the 'cpu_context_t' structure */ +#define get_el3state_ctx(h) (&((cpu_context_t *) h)->el3state_ctx) +#define get_fpregs_ctx(h) (&((cpu_context_t *) h)->fpregs_ctx) +#define get_sysregs_ctx(h) (&((cpu_context_t *) h)->sysregs_ctx) +#define get_gpregs_ctx(h) (&((cpu_context_t *) h)->gpregs_ctx) /* * Compile time assertions related to the 'cpu_context' structure to * ensure that the assembler and the compiler view of the offsets of * the structure members is the same. */ -CASSERT(CTX_GPREGS_OFFSET == __builtin_offsetof(cpu_context, gpregs_ctx), \ +CASSERT(CTX_GPREGS_OFFSET == __builtin_offsetof(cpu_context_t, gpregs_ctx), \ assert_core_context_gp_offset_mismatch); -CASSERT(CTX_SYSREGS_OFFSET == __builtin_offsetof(cpu_context, sysregs_ctx), \ +CASSERT(CTX_SYSREGS_OFFSET == __builtin_offsetof(cpu_context_t, sysregs_ctx), \ assert_core_context_sys_offset_mismatch); -CASSERT(CTX_FPREGS_OFFSET == __builtin_offsetof(cpu_context, fpregs_ctx), \ +CASSERT(CTX_FPREGS_OFFSET == __builtin_offsetof(cpu_context_t, fpregs_ctx), \ assert_core_context_fp_offset_mismatch); -CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context, el3state_ctx), \ +CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context_t, el3state_ctx), \ assert_core_context_el3state_offset_mismatch); /* @@ -298,12 +298,12 @@ CASSERT(CTX_EL3STATE_OFFSET == __builtin_offsetof(cpu_context, el3state_ctx), \ /******************************************************************************* * Function prototypes ******************************************************************************/ -void el3_sysregs_context_save(el3_state *regs); -void el3_sysregs_context_restore(el3_state *regs); -void el1_sysregs_context_save(el1_sys_regs *regs); -void el1_sysregs_context_restore(el1_sys_regs *regs); -void fpregs_context_save(fp_regs *regs); -void fpregs_context_restore(fp_regs *regs); +void el3_sysregs_context_save(el3_state_t *regs); +void el3_sysregs_context_restore(el3_state_t *regs); +void el1_sysregs_context_save(el1_sys_regs_t *regs); +void el1_sysregs_context_restore(el1_sys_regs_t *regs); +void fpregs_context_save(fp_regs_t *regs); +void fpregs_context_restore(fp_regs_t *regs); #undef CTX_SYSREG_ALL #undef CTX_FP_ALL diff --git a/include/bl31/runtime_svc.h b/include/bl31/runtime_svc.h index 90d6700a4..ac85fa3f2 100644 --- a/include/bl31/runtime_svc.h +++ b/include/bl31/runtime_svc.h @@ -130,7 +130,7 @@ #define is_caller_secure(_f) (!(is_caller_non_secure(_f))) /* Prototype for runtime service initializing function */ -typedef int32_t (*rt_svc_init)(void); +typedef int32_t (*rt_svc_init_t)(void); /* Convenience macros to return from SMC handler */ #define SMC_RET1(_h, _x0) { \ @@ -175,7 +175,7 @@ typedef int32_t (*rt_svc_init)(void); * can be accessed using the handle pointer. The cookie parameter is reserved * for future use */ -typedef uint64_t (*rt_svc_handle)(uint32_t smc_fid, +typedef uint64_t (*rt_svc_handle_t)(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, @@ -183,20 +183,20 @@ typedef uint64_t (*rt_svc_handle)(uint32_t smc_fid, void *cookie, void *handle, uint64_t flags); -typedef struct { +typedef struct rt_svc_desc { uint8_t start_oen; uint8_t end_oen; uint8_t call_type; const char *name; - rt_svc_init init; - rt_svc_handle handle; -} rt_svc_desc; + rt_svc_init_t init; + rt_svc_handle_t handle; +} rt_svc_desc_t; /* * Convenience macro to declare a service descriptor */ #define DECLARE_RT_SVC(_name, _start, _end, _type, _setup, _smch) \ - static const rt_svc_desc __svc_desc_ ## _name \ + static const rt_svc_desc_t __svc_desc_ ## _name \ __attribute__ ((section("rt_svc_descs"), used)) = { \ _start, \ _end, \ @@ -214,11 +214,11 @@ typedef struct { * 3. ensure that the assembler and the compiler see the handler * routine at the same offset. */ -CASSERT((sizeof(rt_svc_desc) == SIZEOF_RT_SVC_DESC), \ +CASSERT((sizeof(rt_svc_desc_t) == SIZEOF_RT_SVC_DESC), \ assert_sizeof_rt_svc_desc_mismatch); -CASSERT(RT_SVC_DESC_INIT == __builtin_offsetof(rt_svc_desc, init), \ +CASSERT(RT_SVC_DESC_INIT == __builtin_offsetof(rt_svc_desc_t, init), \ assert_rt_svc_desc_init_offset_mismatch); -CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc, handle), \ +CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc_t, handle), \ assert_rt_svc_desc_handle_offset_mismatch); diff --git a/include/bl31/services/psci.h b/include/bl31/services/psci.h index 351453f0e..ab7b7bdd0 100644 --- a/include/bl31/services/psci.h +++ b/include/bl31/services/psci.h @@ -135,7 +135,7 @@ * Structure populated by platform specific code to export routines which * perform common low level pm functions ******************************************************************************/ -typedef struct { +typedef struct plat_pm_ops { int (*affinst_standby)(unsigned int); int (*affinst_on)(unsigned long, unsigned long, @@ -152,7 +152,7 @@ typedef struct { int (*affinst_suspend_finish)(unsigned long, unsigned int, unsigned int); -} plat_pm_ops; +} plat_pm_ops_t; /******************************************************************************* * Optional structure populated by the Secure Payload Dispatcher to be given a @@ -160,7 +160,7 @@ typedef struct { * operation. It also allows PSCI to determine certain properties of the SP e.g. * migrate capability etc. ******************************************************************************/ -typedef struct { +typedef struct spd_pm_ops { void (*svc_on)(uint64_t target_cpu); int32_t (*svc_off)(uint64_t __unused); void (*svc_suspend)(uint64_t power_state); @@ -168,7 +168,7 @@ typedef struct { void (*svc_suspend_finish)(uint64_t suspend_level); void (*svc_migrate)(uint64_t __unused1, uint64_t __unused2); int32_t (*svc_migrate_info)(uint64_t *__unused); -} spd_pm_ops; +} spd_pm_ops_t; /******************************************************************************* * Function & Data prototypes @@ -187,7 +187,7 @@ extern int psci_cpu_on(unsigned long, unsigned long); extern void psci_aff_on_finish_entry(void); extern void psci_aff_suspend_finish_entry(void); -extern void psci_register_spd_pm_hook(const spd_pm_ops *); +extern void psci_register_spd_pm_hook(const spd_pm_ops_t *); extern int psci_get_suspend_stateid(unsigned long mpidr); extern int psci_get_suspend_afflvl(unsigned long mpidr); diff --git a/include/bl32/bl32.h b/include/bl32/bl32.h index 88e18bd31..e46988193 100644 --- a/include/bl32/bl32.h +++ b/include/bl32/bl32.h @@ -37,7 +37,7 @@ #include <bl_common.h> extern void bl32_platform_setup(void); -extern meminfo *bl32_plat_sec_mem_layout(void); +extern meminfo_t *bl32_plat_sec_mem_layout(void); extern uint64_t bl32_main(void); #endif /* __ASSEMBLY__ */ diff --git a/include/bl32/payloads/tsp.h b/include/bl32/payloads/tsp.h index 68a65b27d..4ac7a1aaf 100644 --- a/include/bl32/payloads/tsp.h +++ b/include/bl32/payloads/tsp.h @@ -88,7 +88,7 @@ #ifndef __ASSEMBLY__ #include <stdint.h> -typedef void (*tsp_generic_fptr)(uint64_t arg0, +typedef void (*tsp_generic_fptr_t)(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, @@ -97,26 +97,26 @@ typedef void (*tsp_generic_fptr)(uint64_t arg0, uint64_t arg6, uint64_t arg7); -typedef struct { - tsp_generic_fptr fast_smc_entry; - tsp_generic_fptr cpu_on_entry; - tsp_generic_fptr cpu_off_entry; - tsp_generic_fptr cpu_resume_entry; - tsp_generic_fptr cpu_suspend_entry; -} entry_info; +typedef struct entry_info { + tsp_generic_fptr_t fast_smc_entry; + tsp_generic_fptr_t cpu_on_entry; + tsp_generic_fptr_t cpu_off_entry; + tsp_generic_fptr_t cpu_resume_entry; + tsp_generic_fptr_t cpu_suspend_entry; +} entry_info_t; -typedef struct { +typedef struct work_statistics { uint32_t smc_count; /* Number of returns on this cpu */ uint32_t eret_count; /* Number of entries on this cpu */ uint32_t cpu_on_count; /* Number of cpu on requests */ uint32_t cpu_off_count; /* Number of cpu off requests */ uint32_t cpu_suspend_count; /* Number of cpu suspend requests */ uint32_t cpu_resume_count; /* Number of cpu resume requests */ -} __aligned(CACHE_WRITEBACK_GRANULE) work_statistics; +} __aligned(CACHE_WRITEBACK_GRANULE) work_statistics_t; -typedef struct { +typedef struct tsp_args { uint64_t _regs[TSP_ARGS_END >> 3]; -} __aligned(CACHE_WRITEBACK_GRANULE) tsp_args; +} __aligned(CACHE_WRITEBACK_GRANULE) tsp_args_t; /* Macros to access members of the above structure using their offsets */ #define read_sp_arg(args, offset) ((args)->_regs[offset >> 3]) @@ -127,7 +127,7 @@ typedef struct { * Ensure that the assembler's view of the size of the tsp_args is the * same as the compilers */ -CASSERT(TSP_ARGS_SIZE == sizeof(tsp_args), assert_sp_args_size_mismatch); +CASSERT(TSP_ARGS_SIZE == sizeof(tsp_args_t), assert_sp_args_size_mismatch); extern void tsp_get_magic(uint64_t args[4]); @@ -147,7 +147,7 @@ extern void tsp_cpu_resume_entry(uint64_t arg0, uint64_t arg5, uint64_t arg6, uint64_t arg7); -extern tsp_args *tsp_cpu_resume_main(uint64_t arg0, +extern tsp_args_t *tsp_cpu_resume_main(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, @@ -163,7 +163,7 @@ extern void tsp_cpu_suspend_entry(uint64_t arg0, uint64_t arg5, uint64_t arg6, uint64_t arg7); -extern tsp_args *tsp_cpu_suspend_main(uint64_t arg0, +extern tsp_args_t *tsp_cpu_suspend_main(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, @@ -179,7 +179,7 @@ extern void tsp_cpu_on_entry(uint64_t arg0, uint64_t arg5, uint64_t arg6, uint64_t arg7); -extern tsp_args *tsp_cpu_on_main(void); +extern tsp_args_t *tsp_cpu_on_main(void); extern void tsp_cpu_off_entry(uint64_t arg0, uint64_t arg1, uint64_t arg2, @@ -188,7 +188,7 @@ extern void tsp_cpu_off_entry(uint64_t arg0, uint64_t arg5, uint64_t arg6, uint64_t arg7); -extern tsp_args *tsp_cpu_off_main(uint64_t arg0, +extern tsp_args_t *tsp_cpu_off_main(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, diff --git a/include/common/bl_common.h b/include/common/bl_common.h index 527f64727..1eb6d79a4 100644 --- a/include/common/bl_common.h +++ b/include/common/bl_common.h @@ -64,16 +64,16 @@ * Structure used for telling the next BL how much of a particular type of * memory is available for its use and how much is already used. ******************************************************************************/ -typedef struct { +typedef struct meminfo { unsigned long total_base; long total_size; unsigned long free_base; long free_size; unsigned long attr; unsigned long next; -} meminfo; +} meminfo_t; -typedef struct { +typedef struct aapcs64_params { unsigned long arg0; unsigned long arg1; unsigned long arg2; @@ -82,51 +82,51 @@ typedef struct { unsigned long arg5; unsigned long arg6; unsigned long arg7; -} aapcs64_params; +} aapcs64_params_t; /******************************************************************************* * This structure represents the superset of information needed while switching * exception levels. The only two mechanisms to do so are ERET & SMC. In case of * SMC all members apart from 'aapcs64_params' will be ignored. ******************************************************************************/ -typedef struct { +typedef struct el_change_info { unsigned long entrypoint; unsigned long spsr; unsigned long security_state; - aapcs64_params args; -} el_change_info; + aapcs64_params_t args; +} el_change_info_t; /******************************************************************************* * This structure represents the superset of information that can be passed to * BL31 e.g. while passing control to it from BL2. The BL32 parameters will be * populated only if BL2 detects its presence. ******************************************************************************/ -typedef struct { - meminfo bl31_meminfo; - el_change_info bl32_image_info; - meminfo bl32_meminfo; - el_change_info bl33_image_info; - meminfo bl33_meminfo; -} bl31_args; +typedef struct bl31_args { + meminfo_t bl31_meminfo; + el_change_info_t bl32_image_info; + meminfo_t bl32_meminfo; + el_change_info_t bl33_image_info; + meminfo_t bl33_meminfo; +} bl31_args_t; /******************************************************************************* * Function & variable prototypes ******************************************************************************/ extern unsigned long page_align(unsigned long, unsigned); extern void change_security_state(unsigned int); -extern void __dead2 drop_el(aapcs64_params *, unsigned long, unsigned long); -extern void __dead2 raise_el(aapcs64_params *); -extern void __dead2 change_el(el_change_info *); +extern void __dead2 drop_el(aapcs64_params_t *, unsigned long, unsigned long); +extern void __dead2 raise_el(aapcs64_params_t *); +extern void __dead2 change_el(el_change_info_t *); extern unsigned long make_spsr(unsigned long, unsigned long, unsigned long); -extern void init_bl2_mem_layout(meminfo *, - meminfo *, +extern void init_bl2_mem_layout(meminfo_t *, + meminfo_t *, unsigned int, unsigned long) __attribute__((weak)); -extern void init_bl31_mem_layout(const meminfo *, - meminfo *, +extern void init_bl31_mem_layout(const meminfo_t *, + meminfo_t *, unsigned int) __attribute__((weak)); extern unsigned long image_size(const char *); -extern unsigned long load_image(meminfo *, +extern unsigned long load_image(meminfo_t *, const char *, unsigned int, unsigned long); diff --git a/include/common/firmware_image_package.h b/include/common/firmware_image_package.h index ff5e971d5..f4554ecc6 100644 --- a/include/common/firmware_image_package.h +++ b/include/common/firmware_image_package.h @@ -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__ */ diff --git a/include/drivers/arm/tzc400.h b/include/drivers/arm/tzc400.h index 7eaafd2e3..7ac82ae63 100644 --- a/include/drivers/arm/tzc400.h +++ b/include/drivers/arm/tzc400.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__*/ diff --git a/include/drivers/io_driver.h b/include/drivers/io_driver.h index 5e3d1327e..cade5e706 100644 --- a/include/drivers/io_driver.h +++ b/include/drivers/io_driver.h @@ -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__ */ diff --git a/include/lib/aarch64/xlat_tables.h b/include/lib/aarch64/xlat_tables.h index 01b1afefe..d7e1c60b1 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 6e6e96635..0def06748 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 04e63c307..59fd3f479 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 94aaa1ac2..cb0bc3e5d 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; |