arm-trusted-firmware/lib
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 TF-A Aarch32: optimise memcpy4() 2020-07-23 18:35:49 +01:00
aarch64 Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
bl_aux_params Introduce lightweight BL platform parameter library 2019-07-18 16:42:40 -07:00
compiler-rt compiler_rt: Import popcountdi2.c and popcountsi2.c files 2020-01-20 11:32:59 +01:00
coreboot coreboot: Add memory range parsing 2020-04-07 07:35:26 +00:00
cpus Workaround for Cortex A77 erratum 1925769 2020-10-07 21:15:38 +00:00
debugfs cert_create: add Platform owned secure partitions support 2020-08-12 14:30:18 +01:00
el3_runtime Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
extensions SPE: Fix feature detection 2020-09-14 18:00:18 +01:00
fconf lib: fconf: Implement a parser to populate CoT 2020-09-15 16:13:26 +01:00
libc Merge "plat/arm: Introduce and use libc_asm.mk makefile" into integration 2020-09-24 14:39:24 +00:00
libfdt libfdt: Upgrade libfdt source files 2020-10-02 12:15:48 +00:00
locks locks: bakery: use is_dcache_enabled() helper 2020-04-07 09:33:13 +02:00
optee Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
pmf Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
psci Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
romlib Use abspath to dereference $BUILD_BASE 2020-08-04 18:02:02 +01:00
semihosting MISRA cleanup in mem_region and semihosting files 2020-08-07 19:11:23 -05:00
stack_protector Disable stack protection explicitly 2019-10-20 14:59:09 -04:00
utils MISRA cleanup in mem_region and semihosting files 2020-08-07 19:11:23 -05:00
xlat_tables Aarch32 xlat_tables lib: Fix MISRA-2012 defects 2020-07-29 12:48:34 +00:00
xlat_tables_v2 Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
zlib Sanitise includes across codebase 2019-01-04 10:43:17 +00:00