arm-trusted-firmware/lib/romlib/init.s
Roberto Vargas 5accce5bcc Add support for romlib in the build system
Romlib is a new image that is stored in ROM and contains the code of
several libraries that can be shared between different images. All
the functions within in the library are accessed using a jump table
which allows to update the romlib image whithout changing the binary
compatibility. This jump table can be also stored in RAM and it can
allow to patch a romlib with potential bugs fixes..

Change-Id: If980ccdaca24b7aaca900e32acc68baf6f94ab35
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-08-03 11:31:42 +01:00

30 lines
524 B
ArmAsm

/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
.globl rom_lib_init
.extern __DATA_RAM_START__, __DATA_ROM_START__, __DATA_SIZE__
.extern memset, memcpy
rom_lib_init:
cmp w0, #1
mov w0, #0
b.le 1f
ret
1: stp x29, x30, [sp, #-16]!
adrp x0, __DATA_RAM_START__
ldr x1,= __DATA_ROM_START__
ldr x2, =__DATA_SIZE__
bl memcpy
ldr x0, =__BSS_START__
mov x1, #0
ldr x2, =__BSS_SIZE__
bl memset
ldp x29, x30, [sp], #16
mov w0, #1
ret