arm-trusted-firmware/include/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
..
bl_aux_params Factor out cross-BL API into export headers suitable for 3rd party code 2019-07-23 20:25:34 -07:00
cpus Merge "Workaround for Cortex A77 erratum 1925769" into integration 2020-10-09 19:17:23 +00:00
el3_runtime el3_runtime: Rearrange context offset of EL1 sys registers 2020-08-18 10:49:27 +01:00
extensions TF-A AMU extension: fix detection of group 1 counters. 2020-08-10 10:40:53 +00:00
fconf lib/fconf: Update 'set_fw_config_info' function 2020-07-23 02:11:13 +00:00
libc libc: Import strtok_r from FreeBSD project 2020-09-18 11:58:41 -05:00
libfdt libfdt: Upgrade libfdt source files 2020-10-02 12:15:48 +00:00
pmf Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
psci psci: utility api to invoke stop for other cores 2020-09-03 09:29:22 +00:00
xlat_tables Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
zlib Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
bakery_lock.h Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
cassert.h Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
coreboot.h coreboot: Add memory range parsing 2020-04-07 07:35:26 +00:00
debugfs.h debugfs: add SMC channel 2019-12-18 09:59:12 +01:00
mmio.h Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
object_pool.h fconf: Fix misra issues 2020-02-27 16:14:07 +00:00
optee_utils.h Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
runtime_instr.h Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
semihosting.h qemu: Implement qemu_system_off via semihosting. 2020-01-23 10:53:45 +00:00
smccc.h Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
spinlock.h Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
utils.h arm: gicv3: Fix compiler dependent behavior 2019-12-10 15:53:44 -06:00
utils_def.h Fix MISRA C issues in BL1/BL2/BL31 2020-04-03 16:20:59 -05:00