diff options
author | Dan Handley <dan.handley@arm.com> | 2014-04-10 15:37:22 +0100 |
---|---|---|
committer | Dan Handley <dan.handley@arm.com> | 2014-05-06 13:57:48 +0100 |
commit | fb037bfb7cbf7b404c069b4ebac5a10059d948b1 (patch) | |
tree | 7039b044f48574085b3d3c6a2e7c20d41a87da20 /include/drivers/arm/tzc400.h | |
parent | c5945735a9705675201d2799654348425f28f551 (diff) | |
download | platform_external_arm-trusted-firmware-fb037bfb7cbf7b404c069b4ebac5a10059d948b1.tar.gz platform_external_arm-trusted-firmware-fb037bfb7cbf7b404c069b4ebac5a10059d948b1.tar.bz2 platform_external_arm-trusted-firmware-fb037bfb7cbf7b404c069b4ebac5a10059d948b1.zip |
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/drivers/arm/tzc400.h')
-rw-r--r-- | include/drivers/arm/tzc400.h | 25 |
1 files changed, 12 insertions, 13 deletions
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__*/ |