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
0d845356
Unverified
Commit
0d845356
authored
6 years ago
by
Antonio Niño Díaz
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1800 from sandrine-bailleux-arm/sb/load-img-v2
Remove dead code related to LOAD_IMAGE_V2=0
parents
48eccbc2
c4e9d827
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
v2.2
v2.2-rc2
v2.2-rc1
v2.2-rc0
v2.1
v2.1-rc1
v2.1-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/bl_common.c
+0
-86
common/bl_common.c
docs/porting-guide.rst
+0
-3
docs/porting-guide.rst
include/common/bl_common.h
+0
-5
include/common/bl_common.h
with
0 additions
and
94 deletions
+0
-94
common/bl_common.c
View file @
0d845356
...
...
@@ -58,92 +58,6 @@ uintptr_t page_align(uintptr_t value, unsigned dir)
return
value
;
}
/******************************************************************************
* Determine whether the memory region delimited by 'addr' and 'size' is free,
* given the extents of free memory.
* Return 1 if it is free, 0 if it is not free or if the input values are
* invalid.
*****************************************************************************/
int
is_mem_free
(
uintptr_t
free_base
,
size_t
free_size
,
uintptr_t
addr
,
size_t
size
)
{
uintptr_t
free_end
,
requested_end
;
/*
* Handle corner cases first.
*
* The order of the 2 tests is important, because if there's no space
* left (i.e. free_size == 0) but we don't ask for any memory
* (i.e. size == 0) then we should report that the memory is free.
*/
if
(
size
==
0
)
return
1
;
/* A zero-byte region is always free */
if
(
free_size
==
0
)
return
0
;
/*
* Check that the end addresses don't overflow.
* If they do, consider that this memory region is not free, as this
* is an invalid scenario.
*/
if
(
check_uptr_overflow
(
free_base
,
free_size
-
1
))
return
0
;
free_end
=
free_base
+
(
free_size
-
1
);
if
(
check_uptr_overflow
(
addr
,
size
-
1
))
return
0
;
requested_end
=
addr
+
(
size
-
1
);
/*
* Finally, check that the requested memory region lies within the free
* region.
*/
return
(
addr
>=
free_base
)
&&
(
requested_end
<=
free_end
);
}
/* Generic function to return the size of an image */
size_t
get_image_size
(
unsigned
int
image_id
)
{
uintptr_t
dev_handle
;
uintptr_t
image_handle
;
uintptr_t
image_spec
;
size_t
image_size
=
0U
;
int
io_result
;
/* Obtain a reference to the image by querying the platform layer */
io_result
=
plat_get_image_source
(
image_id
,
&
dev_handle
,
&
image_spec
);
if
(
io_result
!=
0
)
{
WARN
(
"Failed to obtain reference to image id=%u (%i)
\n
"
,
image_id
,
io_result
);
return
0
;
}
/* Attempt to access the image */
io_result
=
io_open
(
dev_handle
,
image_spec
,
&
image_handle
);
if
(
io_result
!=
0
)
{
WARN
(
"Failed to access image id=%u (%i)
\n
"
,
image_id
,
io_result
);
return
0
;
}
/* Find the size of the image */
io_result
=
io_size
(
image_handle
,
&
image_size
);
if
((
io_result
!=
0
)
||
(
image_size
==
0U
))
{
WARN
(
"Failed to determine the size of the image id=%u (%i)
\n
"
,
image_id
,
io_result
);
}
io_result
=
io_close
(
image_handle
);
/* Ignore improbable/unrecoverable error in 'close' */
/* TODO: Consider maintaining open device connection from this
* bootloader stage
*/
io_result
=
io_dev_close
(
dev_handle
);
/* Ignore improbable/unrecoverable error in 'dev_close' */
return
image_size
;
}
/*******************************************************************************
* Internal function to load an image at a specific address given
* an image ID and extents of free memory.
...
...
This diff is collapsed.
Click to expand it.
docs/porting-guide.rst
View file @
0d845356
...
...
@@ -1198,9 +1198,6 @@ the BL1 stage.
meminfo.total_base = Base address of secure RAM visible to BL1
meminfo.total_size = Size of secure RAM visible to BL1
meminfo.free_base = Base address of secure RAM available for allocation
to BL1
meminfo.free_size = Size of secure RAM available for allocation to BL1
This information is used by BL1 to load the BL2 image in secure RAM. BL1 also
populates a similar structure to tell BL2 the extents of memory available for
...
...
This diff is collapsed.
Click to expand it.
include/common/bl_common.h
View file @
0d845356
...
...
@@ -189,11 +189,6 @@ typedef struct bl_params {
/*******************************************************************************
* Function & variable prototypes
******************************************************************************/
size_t
get_image_size
(
unsigned
int
image_id
);
int
is_mem_free
(
uintptr_t
free_base
,
size_t
free_size
,
uintptr_t
addr
,
size_t
size
);
int
load_auth_image
(
unsigned
int
image_id
,
image_info_t
*
image_data
);
#if TRUSTED_BOARD_BOOT && defined(DYN_DISABLE_AUTH)
...
...
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