Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
46d58f80
Unverified
Commit
46d58f80
authored
6 years ago
by
Dimitris Papastamos
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1902 from jts-arm/romlib
ROMLIB bug fixes
parents
cc0dcf42
ae2e01b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
docs/romlib-design.rst
+12
-4
docs/romlib-design.rst
lib/romlib/Makefile
+6
-9
lib/romlib/Makefile
lib/romlib/genwrappers.sh
+3
-3
lib/romlib/genwrappers.sh
plat/arm/board/fvp/jmptbl.i
+30
-2
plat/arm/board/fvp/jmptbl.i
plat/arm/board/juno/jmptbl.i
+30
-2
plat/arm/board/juno/jmptbl.i
with
81 additions
and
20 deletions
+81
-20
docs/romlib-design.rst
View file @
46d58f80
...
@@ -85,12 +85,12 @@ ROM" to work:
...
@@ -85,12 +85,12 @@ ROM" to work:
1. ``gentbl.sh`` - Generates the jump table by parsing the index file.
1. ``gentbl.sh`` - Generates the jump table by parsing the index file.
2. ``genvar.sh`` - Generates the jump table global variable (**not** the jump
2. ``genvar.sh`` - Generates the jump table global variable (**not** the jump
table itself) with the absolute address in ROM. This global variable is,
table itself) with the absolute address in ROM. This global variable is,
basically, a pointer to the jump table.
basically, a pointer to the jump table.
3. ``genwrappers.sh`` - Generates a wrapper function for each entry in the index
3. ``genwrappers.sh`` - Generates a wrapper function for each entry in the index
file except for the ones that contain the keyword ``patch``. The generated
file except for the ones that contain the keyword ``patch``. The generated
wrapper file is called ``<lib>_<fn_name>.S``.
wrapper file is called ``<lib>_<fn_name>.S``.
Patching of functions in library at ROM
Patching of functions in library at ROM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
@@ -108,6 +108,8 @@ Build library at ROM
...
@@ -108,6 +108,8 @@ Build library at ROM
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
The environment variable ``CROSS_COMPILE`` must be set as per the user guide.
The environment variable ``CROSS_COMPILE`` must be set as per the user guide.
In the below example the usage of ROMLIB together with mbed TLS is demonstrated
to showcase the benefits of library at ROM - it's not mandatory.
::
::
...
@@ -120,6 +122,12 @@ The environment variable ``CROSS_COMPILE`` must be set as per the user guide.
...
@@ -120,6 +122,12 @@ The environment variable ``CROSS_COMPILE`` must be set as per the user guide.
USE_ROMLIB=1 \
USE_ROMLIB=1 \
all fip
all fip
Known issue
-----------
When building library at ROM, a clean build is always required. This is
necessary when changes are made to the index files, e.g. adding new functions,
patching existing ones etc.
--------------
--------------
*Copyright (c) 2019, Arm Limited. All rights reserved.*
*Copyright (c) 2019, Arm Limited. All rights reserved.*
This diff is collapsed.
Click to expand it.
lib/romlib/Makefile
View file @
46d58f80
#
#
# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2018
-2019
, ARM Limited and Contributors. All rights reserved.
#
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: BSD-3-Clause
#
#
...
@@ -58,18 +58,15 @@ $(WRAPPER_DIR)/jmpvar.s: $(BUILD_DIR)/romlib.elf
...
@@ -58,18 +58,15 @@ $(WRAPPER_DIR)/jmpvar.s: $(BUILD_DIR)/romlib.elf
@
echo
" VAR
$@
"
@
echo
" VAR
$@
"
$(Q)
./genvar.sh
-o
$@
$(BUILD_DIR)
/romlib.elf
$(Q)
./genvar.sh
-o
$@
$(BUILD_DIR)
/romlib.elf
$(LIB_DIR)/libwrappers.a
:
jmptbl.i $(WRAPPER_DIR)/jmpvar.o
$(LIB_DIR)/libwrappers.a
:
$(BUILD_DIR)/
jmptbl.i $(WRAPPER_DIR)/jmpvar.o
@
echo
" AR
$@
"
@
echo
" AR
$@
"
$(Q)
./genwrappers.sh
-b
$(WRAPPER_DIR)
-o
$@
$(BUILD_DIR)
/jmptbl.i
$(Q)
./genwrappers.sh
-b
$(WRAPPER_DIR)
-o
$@
$(BUILD_DIR)
/jmptbl.i
$(BUILD_DIR)/jmptbl.s
:
jmptbl.i
$(BUILD_DIR)/jmptbl.i
:
$(BUILD_DIR)/jmptbl.s
$(BUILD_DIR)/jmptbl.s
:
../../$(PLAT_DIR)/jmptbl.i
@
echo
" TBL
$@
"
@
echo
" TBL
$@
"
if
[
-e
"../../
$(PLAT_DIR)
/jmptbl.i"
]
;
\
$(Q)
./gentbl.sh
-o
$@
-b
$(BUILD_DIR)
../../
$(PLAT_DIR)
/jmptbl.i
then
\
$(Q)
./gentbl.sh
-o
$@
-b
$(BUILD_DIR)
../../
$(PLAT_DIR)
/jmptbl.i
;
\
else
\
@echo
"USE_ROMLIB=1 requires jump table list file: jmptbl.i in platform directory"
;
\
fi
clean
:
clean
:
@
rm
-f
$(BUILD_DIR)
/
*
@
rm
-f
$(BUILD_DIR)
/
*
...
...
This diff is collapsed.
Click to expand it.
lib/romlib/genwrappers.sh
View file @
46d58f80
#!/bin/sh
#!/bin/sh
# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2018
-2019
, ARM Limited and Contributors. All rights reserved.
#
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: BSD-3-Clause
...
@@ -31,7 +31,7 @@ do
...
@@ -31,7 +31,7 @@ do
done
done
awk
'{sub(/[:blank:]*#.*/,"")}
awk
'{sub(/[:blank:]*#.*/,"")}
!/^$/ &&
!/\\tpatch$/ !/\\t
reserved
$/
{print $1*4, $2, $3}'
"
$@
"
|
!/^$/ &&
$NF != "patch" && $NF != "
reserved
"
{print $1*4, $2, $3}'
"
$@
"
|
while
read
idx lib sym
while
read
idx lib sym
do
do
file
=
$build
/
${
lib
}
_
$sym
file
=
$build
/
${
lib
}
_
$sym
...
@@ -41,7 +41,7 @@ do
...
@@ -41,7 +41,7 @@ do
$sym
:
$sym
:
ldr x17, =jmptbl
ldr x17, =jmptbl
ldr x17, [x17]
ldr x17, [x17]
mov x16,
$idx
mov x16,
#
$idx
add x16, x16, x17
add x16, x16, x17
br x16
br x16
EOF
EOF
...
...
This diff is collapsed.
Click to expand it.
plat/arm/board/fvp/jmptbl.i
View file @
46d58f80
#
#
#
Copyright
(
c
)
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
#
Copyright
(
c
)
2018
-
2019
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
#
#
#
SPDX-License-Identifier
:
BSD-3-Clause
#
SPDX-License-Identifier
:
BSD-3-Clause
#
#
...
@@ -14,4 +14,32 @@
...
@@ -14,4 +14,32 @@
#
rom
rom_lib_init
#
rom
rom_lib_init
#
fdt
fdt_getprop_namelen
patch
#
fdt
fdt_getprop_namelen
patch
include
..
/
..
/
lib
/
romlib
/
jmptbl
.
i
rom
rom_lib_init
fdt
fdt_getprop_namelen
fdt
fdt_setprop_inplace
fdt
fdt_check_header
fdt
fdt_node_offset_by_compatible
mbedtls
mbedtls_asn1_get_alg
mbedtls
mbedtls_asn1_get_alg_null
mbedtls
mbedtls_asn1_get_bitstring_null
mbedtls
mbedtls_asn1_get_bool
mbedtls
mbedtls_asn1_get_int
mbedtls
mbedtls_asn1_get_tag
mbedtls
mbedtls_free
mbedtls
mbedtls_md
mbedtls
mbedtls_md_get_size
mbedtls
mbedtls_memory_buffer_alloc_init
mbedtls
mbedtls_oid_get_md_alg
mbedtls
mbedtls_oid_get_numeric_string
mbedtls
mbedtls_oid_get_pk_alg
mbedtls
mbedtls_oid_get_sig_alg
mbedtls
mbedtls_pk_free
mbedtls
mbedtls_pk_init
mbedtls
mbedtls_pk_parse_subpubkey
mbedtls
mbedtls_pk_verify_ext
mbedtls
mbedtls_platform_set_snprintf
mbedtls
mbedtls_x509_get_rsassa_pss_params
mbedtls
mbedtls_x509_get_sig_alg
mbedtls
mbedtls_md_info_from_type
c
exit
c
atexit
This diff is collapsed.
Click to expand it.
plat/arm/board/juno/jmptbl.i
View file @
46d58f80
#
#
#
Copyright
(
c
)
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
#
Copyright
(
c
)
2018
-
2019
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
#
#
#
SPDX-License-Identifier
:
BSD-3-Clause
#
SPDX-License-Identifier
:
BSD-3-Clause
#
#
...
@@ -14,4 +14,32 @@
...
@@ -14,4 +14,32 @@
#
rom
rom_lib_init
#
rom
rom_lib_init
#
fdt
fdt_getprop_namelen
patch
#
fdt
fdt_getprop_namelen
patch
include
..
/
..
/
lib
/
romlib
/
jmptbl
.
i
rom
rom_lib_init
fdt
fdt_getprop_namelen
fdt
fdt_setprop_inplace
fdt
fdt_check_header
fdt
fdt_node_offset_by_compatible
mbedtls
mbedtls_asn1_get_alg
mbedtls
mbedtls_asn1_get_alg_null
mbedtls
mbedtls_asn1_get_bitstring_null
mbedtls
mbedtls_asn1_get_bool
mbedtls
mbedtls_asn1_get_int
mbedtls
mbedtls_asn1_get_tag
mbedtls
mbedtls_free
mbedtls
mbedtls_md
mbedtls
mbedtls_md_get_size
mbedtls
mbedtls_memory_buffer_alloc_init
mbedtls
mbedtls_oid_get_md_alg
mbedtls
mbedtls_oid_get_numeric_string
mbedtls
mbedtls_oid_get_pk_alg
mbedtls
mbedtls_oid_get_sig_alg
mbedtls
mbedtls_pk_free
mbedtls
mbedtls_pk_init
mbedtls
mbedtls_pk_parse_subpubkey
mbedtls
mbedtls_pk_verify_ext
mbedtls
mbedtls_platform_set_snprintf
mbedtls
mbedtls_x509_get_rsassa_pss_params
mbedtls
mbedtls_x509_get_sig_alg
mbedtls
mbedtls_md_info_from_type
c
exit
c
atexit
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help