firmware: Move memcpy/memset mapping to fw_base.S
authorAnup Patel <anup.patel@wdc.com>
Wed, 22 Dec 2021 12:31:23 +0000 (18:01 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 23 Dec 2021 12:16:09 +0000 (17:46 +0530)
commitd30bde36d5b7a7ad74176ddf9ede4d7eb2bca86b
tree95b9504a02cd7f808bcf07c6003c03b19133d865
parent2082153fc90c54b98647b1fbaeb7511fd57b7d2b
firmware: Move memcpy/memset mapping to fw_base.S

Some of the external firmwares using OpenSBI as library are facing
issues with the weak memcpy() and memset() aliases in libsbi.a so
we move these to fw_base.S. This way mapping of implicit memcpy()
or memset() calls to sbi_memcpy() or sbi_memset() will only be done
for OpenSBI firmwares.
(Refer, https://github.com/riscv-software-src/opensbi/issues/234)

In addition, we also add memmove() and memcmp() mappings in fw_base.S
because as-per the GCC documentation the freestanding environment must
provide memcpy(), memmove(), memset(), and memcmp().

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
firmware/fw_base.S
lib/sbi/sbi_string.c