diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-07-03 11:58:49 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-07-03 13:41:07 +0100 |
commit | fd2299e6b0dfdf1214e09ba742de3d3f9eadbe0c (patch) | |
tree | 0c119d3a290be37aa816b45d47fc00493a86cf16 /include | |
parent | 6c5e196be37b4afe3403f349d5da1747e12460ac (diff) | |
download | platform_external_arm-trusted-firmware-fd2299e6b0dfdf1214e09ba742de3d3f9eadbe0c.tar.gz platform_external_arm-trusted-firmware-fd2299e6b0dfdf1214e09ba742de3d3f9eadbe0c.tar.bz2 platform_external_arm-trusted-firmware-fd2299e6b0dfdf1214e09ba742de3d3f9eadbe0c.zip |
xlat v2: Split code into separate files
Instead of having one big file with all the code, it's better to have
a few smaller files that are more manageable:
- xlat_tables_core.c: Code related to the core functionality of the
library (map and unmap regions, initialize xlat context).
- xlat_tables_context.c: Instantiation of the active image context
as well as APIs to manipulate it.
- xlat_tables_utils.c: Helper code that isn't part of the core
functionality (change attributes, debug print messages).
Change-Id: I3ea956fc1afd7473c0bb5e7c6aab3b2e5d88c711
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/lib/xlat_tables/xlat_tables_v2.h | 36 | ||||
-rw-r--r-- | include/lib/xlat_tables/xlat_tables_v2_helpers.h | 8 |
2 files changed, 20 insertions, 24 deletions
diff --git a/include/lib/xlat_tables/xlat_tables_v2.h b/include/lib/xlat_tables/xlat_tables_v2.h index 4dc2c5ec7..20a9ea1de 100644 --- a/include/lib/xlat_tables/xlat_tables_v2.h +++ b/include/lib/xlat_tables/xlat_tables_v2.h @@ -123,10 +123,8 @@ typedef struct mmap_region { /* * Translation regimes supported by this library. */ -typedef enum xlat_regime { - EL1_EL0_REGIME, - EL3_REGIME, -} xlat_regime_t; +#define EL1_EL0_REGIME 1 +#define EL3_REGIME 3 /* * Declare the translation context type. @@ -161,12 +159,12 @@ typedef struct xlat_ctx xlat_ctx_t; * (resp. PLAT_PHY_ADDR_SPACE_SIZE) for the translation context describing the * BL image currently executing. */ -#define REGISTER_XLAT_CONTEXT(_ctx_name, _mmap_count, _xlat_tables_count, \ - _virt_addr_space_size, _phy_addr_space_size) \ - _REGISTER_XLAT_CONTEXT_FULL_SPEC(_ctx_name, _mmap_count, \ - _xlat_tables_count, \ - _virt_addr_space_size, \ - _phy_addr_space_size, \ +#define REGISTER_XLAT_CONTEXT(_ctx_name, _mmap_count, _xlat_tables_count, \ + _virt_addr_space_size, _phy_addr_space_size) \ + _REGISTER_XLAT_CONTEXT_FULL_SPEC(_ctx_name, (_mmap_count), \ + (_xlat_tables_count), \ + (_virt_addr_space_size), \ + (_phy_addr_space_size), \ IMAGE_XLAT_DEFAULT_REGIME, \ "xlat_table") @@ -175,20 +173,20 @@ typedef struct xlat_ctx xlat_ctx_t; * * _xlat_regime: * Specify the translation regime managed by this xlat_ctx_t instance. The - * values are the one from xlat_regime_t enumeration. + * values are the one from the EL*_REGIME definitions. * * _section_name: * Specify the name of the section where the translation tables have to be * placed by the linker. */ -#define REGISTER_XLAT_CONTEXT2(_ctx_name, _mmap_count, _xlat_tables_count, \ - _virt_addr_space_size, _phy_addr_space_size, \ - _xlat_regime, _section_name) \ - _REGISTER_XLAT_CONTEXT_FULL_SPEC(_ctx_name, _mmap_count, \ - _xlat_tables_count, \ - _virt_addr_space_size, \ - _phy_addr_space_size, \ - _xlat_regime, _section_name) +#define REGISTER_XLAT_CONTEXT2(_ctx_name, _mmap_count, _xlat_tables_count, \ + _virt_addr_space_size, _phy_addr_space_size, \ + _xlat_regime, _section_name) \ + _REGISTER_XLAT_CONTEXT_FULL_SPEC(_ctx_name, (_mmap_count), \ + (_xlat_tables_count), \ + (_virt_addr_space_size), \ + (_phy_addr_space_size), \ + (_xlat_regime), (_section_name)) /****************************************************************************** * Generic translation table APIs. diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h index e1ea2b64f..56b9a93f4 100644 --- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h +++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h @@ -109,10 +109,8 @@ struct xlat_ctx { unsigned int initialized; /* - * Translation regime managed by this xlat_ctx_t. It takes the values of - * the enumeration xlat_regime_t. The type is "int" to avoid a circular - * dependency on xlat_tables_v2.h, but this member must be treated as - * xlat_regime_t. + * Translation regime managed by this xlat_ctx_t. It should be one of + * the EL*_REGIME defines. */ int xlat_regime; }; @@ -157,7 +155,7 @@ struct xlat_ctx { .va_max_address = (_virt_addr_space_size) - 1, \ .pa_max_address = (_phy_addr_space_size) - 1, \ .mmap = _ctx_name##_mmap, \ - .mmap_num = _mmap_count, \ + .mmap_num = (_mmap_count), \ .base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size), \ .base_table = _ctx_name##_base_xlat_table, \ .base_table_entries = \ |