arm-trusted-firmware/plat/arm/common
Jimmy Brisson d7b5f40823 Increase type widths to satisfy width requirements
Usually, C has no problem up-converting types to larger bit sizes. MISRA
rule 10.7 requires that you not do this, or be very explicit about this.
This resolves the following required rule:

    bl1/aarch64/bl1_context_mgmt.c:81:[MISRA C-2012 Rule 10.7 (required)]<None>
    The width of the composite expression "0U | ((mode & 3U) << 2U) | 1U |
    0x3c0U" (32 bits) is less that the right hand operand
    "18446744073709547519ULL" (64 bits).

This also resolves MISRA defects such as:

    bl2/aarch64/bl2arch_setup.c:18:[MISRA C-2012 Rule 12.2 (required)]
    In the expression "3U << 20", shifting more than 7 bits, the number
    of bits in the essential type of the left expression, "3U", is
    not allowed.

Further, MISRA requires that all shifts don't overflow. The definition of
PAGE_SIZE was (1U << 12), and 1U is 8 bits. This caused about 50 issues.
This fixes the violation by changing the definition to 1UL << 12. Since
this uses 32bits, it should not create any issues for aarch32.

This patch also contains a fix for a build failure in the sun50i_a64
platform. Specifically, these misra fixes removed a single and
instruction,

    92407e73        and     x19, x19, #0xffffffff

from the cm_setup_context function caused a relocation in
psci_cpus_on_start to require a linker-generated stub. This increased the
size of the .text section and caused an alignment later on to go over a
page boundary and round up to the end of RAM before placing the .data
section. This sectionn is of non-zero size and therefore causes a link
error.

The fix included in this reorders the functions during link time
without changing their ording with respect to alignment.

Change-Id: I76b4b662c3d262296728a8b9aab7a33b02087f16
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-12 10:55:03 -05:00
..
aarch32 Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
aarch64 ehf: use common priority level enumuration 2020-08-26 22:02:23 +05:30
fconf Merge "SPM: Get rid of uint32_t array representation of UUID" into integration 2020-09-11 10:47:48 +00:00
sp_min sp_min: Avoid platform security reconfiguration 2020-08-28 10:54:05 +01:00
tsp Merge "pl011: Use generic console_t data structure" into integration 2020-02-25 23:16:14 +00:00
arm_bl1_fwu.c plat/arm: Sanitise includes 2019-01-25 16:04:10 +00:00
arm_bl1_setup.c lib/fconf: Update 'set_fw_config_info' function 2020-07-23 02:11:13 +00:00
arm_bl2_el3_setup.c Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
arm_bl2_setup.c Prevent colliding identifiers 2020-08-14 11:35:35 +00:00
arm_bl2u_setup.c Switch AARCH32/AARCH64 to __aarch64__ 2019-08-01 13:45:03 -07:00
arm_bl31_setup.c plat/arm: Reduce size of BL31 binary 2020-08-10 10:40:35 +00:00
arm_cci.c plat/arm: Sanitise includes 2019-01-25 16:04:10 +00:00
arm_ccn.c plat/arm: Sanitise includes 2019-01-25 16:04:10 +00:00
arm_common.c Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
arm_common.mk Merge "plat/arm: Introduce and use libc_asm.mk makefile" into integration 2020-09-24 14:39:24 +00:00
arm_console.c plat/arm/fvp: populate runtime console parameters dynamically 2020-05-20 21:55:40 -05:00
arm_dyn_cfg.c lib/fconf: Update data type of config max size 2020-07-23 02:11:05 +00:00
arm_dyn_cfg_helpers.c TF-A: Add support for Measured Boot driver 2020-07-21 20:33:07 +00:00
arm_err.c arm: Shorten the Firmware Update (FWU) process 2019-07-23 10:41:41 +01:00
arm_gicv2.c plat/arm: Sanitise includes 2019-01-25 16:04:10 +00:00
arm_gicv3.c arm: gicv3: Fix compiler dependent behavior 2019-12-10 15:53:44 -06:00
arm_image_load.c spmd: skip loading of secure partitions on pre-v8.4 platforms 2020-03-23 19:30:48 +00:00
arm_io_storage.c Check for out-of-bound accesses in the platform io policies 2020-04-02 15:57:55 +02:00
arm_nor_psci_mem_protect.c Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
arm_pm.c Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
arm_sip_svc.c Merge "debugfs: add SMC channel" into integration 2019-12-20 20:56:23 +00:00
arm_topology.c plat/arm: use Aff3 bits also to validate mpidr 2019-10-21 14:09:46 +01:00
arm_tzc400.c plat/arm/tzc: add support to configure multiple tzc400 2020-02-19 13:26:53 +05:30
arm_tzc_dmc500.c plat/arm: Sanitise includes 2019-01-25 16:04:10 +00:00