Replace some memset call by zeromem
authorDouglas Raillard <douglas.raillard@arm.com>
Thu, 26 Jan 2017 15:54:44 +0000 (15:54 +0000)
committerDouglas Raillard <douglas.raillard@arm.com>
Mon, 6 Feb 2017 17:01:39 +0000 (17:01 +0000)
commit32f0d3c6c3fb1fb9353ec0b82ddb099281b9328c
tree2df3f2994752b3c23e269920026a40a5b8d11bb6
parent308d359b260d888f024a2d26c76cd4a50789e432
Replace some memset call by zeromem

Replace all use of memset by zeromem when zeroing moderately-sized
structure by applying the following transformation:
memset(x, 0, sizeof(x)) => zeromem(x, sizeof(x))

As the Trusted Firmware is compiled with -ffreestanding, it forbids the
compiler from using __builtin_memset and forces it to generate calls to
the slow memset implementation. Zeromem is a near drop in replacement
for this use case, with a more efficient implementation on both AArch32
and AArch64.

Change-Id: Ia7f3a90e888b96d056881be09f0b4d65b41aa79e
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
18 files changed:
bl32/sp_min/sp_min_main.c
drivers/auth/mbedtls/mbedtls_x509_parser.c
drivers/emmc/emmc.c
drivers/io/io_block.c
drivers/io/io_fip.c
drivers/io/io_memmap.c
drivers/partition/gpt.c
lib/el3_runtime/aarch32/context_mgmt.c
lib/el3_runtime/aarch64/context_mgmt.c
lib/psci/psci_common.c
plat/arm/common/arm_bl2_setup.c
plat/arm/css/drivers/scpi/css_scpi.c
plat/nvidia/tegra/common/drivers/memctrl/memctrl.c
plat/qemu/qemu_bl2_setup.c
plat/rockchip/rk3399/drivers/dram/dram_spec_timing.c
plat/xilinx/zynqmp/pm_service/pm_client.c
services/spd/opteed/opteed_common.c
services/spd/tspd/tspd_common.c