arm-trusted-firmware/plat
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
..
allwinner plat/allwinner: Use common gicv2.mk 2020-08-17 11:13:01 +01:00
amlogic meson: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
arm Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
brcm driver: brcm: add RNG driver 2020-07-13 18:01:19 +05:30
common ehf: use common priority level enumuration 2020-08-26 22:02:23 +05:30
hisilicon Cleanup the code for TBBR CoT descriptors 2020-05-19 05:05:19 +01:00
imx plat: imx8m: Fix the race condition during cpu hotplug 2020-08-20 14:23:19 +00:00
intel/soc plat: intel: Additional instruction required to enable global timer 2020-06-08 22:03:54 +00:00
layerscape LS 16550: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
marvell plat: marvell: armada: a3k: rename the UART images archive 2020-10-04 15:56:41 +02:00
mediatek mediatek: mt8192: add GIC600 support 2020-09-25 15:04:17 +08:00
nvidia/tegra Merge changes from topic "ehf_common" into integration 2020-09-18 14:20:02 +00:00
qemu plat: Fix build issue for qemu and rpi3 platforms 2020-09-07 13:00:14 +01:00
qti Addition of standard APIs in qtiseclib interface 2020-09-09 12:27:02 +05:30
renesas/rcar rcar_gen3: plat: Zero-terminate the string in unsigned_num_print() 2020-04-28 11:23:37 +02:00
rockchip rockchip: don't crash if we get an FDT we can't parse 2020-07-04 15:37:25 -07:00
rpi plat: Fix build issue for qemu and rpi3 platforms 2020-09-07 13:00:14 +01:00
socionext uniphier: increase BL33 max size and GZIP temporary buffer size 2020-06-29 16:57:11 +09:00
st stm32mp1: cosmetics in platform.mk 2020-10-09 09:24:55 +00:00
ti/k3 Use abspath to dereference $BUILD_BASE 2020-08-04 18:02:02 +01:00
xilinx Merge "Create separate header for ARM specific SMCCC defines" into integration 2020-03-31 14:16:40 +00:00