Skip to content
GitLab
Menu
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
2edf6482
Commit
2edf6482
authored
Apr 21, 2017
by
davidcunado-arm
Committed by
GitHub
Apr 21, 2017
Browse files
Merge pull request #906 from antonio-nino-diaz-arm/an/asserts-release
Add `ENABLE_ASSERTIONS` build option
parents
85aa186b
aa61368e
Changes
27
Hide whitespace changes
Inline
Side-by-side
lib/stdlib/assert.c
View file @
2edf6482
...
...
@@ -32,15 +32,18 @@
#include <debug.h>
#include <platform.h>
/*
* This is a basic implementation. This could be improved.
*/
void
__assert
(
const
char
*
function
,
const
char
*
file
,
unsigned
int
line
,
void
__assert
(
const
char
*
function
,
const
char
*
file
,
unsigned
int
line
,
const
char
*
assertion
)
{
#if LOG_LEVEL >= LOG_LEVEL_INFO
/*
* Only print the output if LOG_LEVEL is higher or equal to
* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
*/
tf_printf
(
"ASSERT: %s <%d> : %s
\n
"
,
function
,
line
,
assertion
);
console_flush
();
#endif
plat_panic_handler
();
}
lib/xlat_tables/aarch32/xlat_tables.c
View file @
2edf6482
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016
-2017
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -85,13 +85,13 @@
static
uint64_t
base_xlation_table
[
NUM_BASE_LEVEL_ENTRIES
]
__aligned
(
NUM_BASE_LEVEL_ENTRIES
*
sizeof
(
uint64_t
));
#if
DEBUG
#if
ENABLE_ASSERTIONS
static
unsigned
long
long
get_max_supported_pa
(
void
)
{
/* Physical address space size for long descriptor format. */
return
(
1ULL
<<
40
)
-
1ULL
;
}
#endif
#endif
/* ENABLE_ASSERTIONS */
void
init_xlat_tables
(
void
)
{
...
...
lib/xlat_tables/aarch64/xlat_tables.c
View file @
2edf6482
...
...
@@ -127,7 +127,7 @@ static unsigned long long calc_physical_addr_size_bits(
return
TCR_PS_BITS_4GB
;
}
#if
DEBUG
#if
ENABLE_ASSERTIONS
/* Physical Address ranges supported in the AArch64 Memory Model */
static
const
unsigned
int
pa_range_bits_arr
[]
=
{
PARANGE_0000
,
PARANGE_0001
,
PARANGE_0010
,
PARANGE_0011
,
PARANGE_0100
,
...
...
@@ -144,7 +144,7 @@ static unsigned long long get_max_supported_pa(void)
return
(
1ULL
<<
pa_range_bits_arr
[
pa_range
])
-
1ULL
;
}
#endif
#endif
/* ENABLE_ASSERTIONS */
void
init_xlat_tables
(
void
)
{
...
...
lib/xlat_tables/xlat_tables_common.c
View file @
2edf6482
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016
-2017
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -109,7 +109,7 @@ void mmap_add_region(unsigned long long base_pa, uintptr_t base_va,
assert
((
base_pa
+
(
unsigned
long
long
)
size
-
1ULL
)
<=
(
PLAT_PHY_ADDR_SPACE_SIZE
-
1
));
#if
DEBUG
#if
ENABLE_ASSERTIONS
/* Check for PAs and VAs overlaps with all other regions */
for
(
mm
=
mmap
;
mm
->
size
;
++
mm
)
{
...
...
@@ -154,7 +154,7 @@ void mmap_add_region(unsigned long long base_pa, uintptr_t base_va,
mm
=
mmap
;
/* Restore pointer to the start of the array */
#endif
/*
DEBUG
*/
#endif
/*
ENABLE_ASSERTIONS
*/
/* Find correct place in mmap to insert new region */
while
(
mm
->
base_va
<
base_va
&&
mm
->
size
)
...
...
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
View file @
2edf6482
...
...
@@ -37,13 +37,13 @@
#include <xlat_tables_v2.h>
#include "../xlat_tables_private.h"
#if
DEBUG
#if
ENABLE_ASSERTIONS
static
unsigned
long
long
xlat_arch_get_max_supported_pa
(
void
)
{
/* Physical address space size for long descriptor format. */
return
(
1ull
<<
40
)
-
1ull
;
}
#endif
/*
DEBUG
*/
#endif
/*
ENABLE_ASSERTIONS
*/
int
is_mmu_enabled
(
void
)
{
...
...
lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
View file @
2edf6482
...
...
@@ -77,7 +77,7 @@ static unsigned long long calc_physical_addr_size_bits(
return
TCR_PS_BITS_4GB
;
}
#if
DEBUG
#if
ENABLE_ASSERTIONS
/* Physical Address ranges supported in the AArch64 Memory Model */
static
const
unsigned
int
pa_range_bits_arr
[]
=
{
PARANGE_0000
,
PARANGE_0001
,
PARANGE_0010
,
PARANGE_0011
,
PARANGE_0100
,
...
...
@@ -94,7 +94,7 @@ unsigned long long xlat_arch_get_max_supported_pa(void)
return
(
1ull
<<
pa_range_bits_arr
[
pa_range
])
-
1ull
;
}
#endif
/*
DEBUG
*/
#endif
/*
ENABLE_ASSERTIONS
*/
int
is_mmu_enabled
(
void
)
{
...
...
plat/common/aarch64/platform_mp_stack.S
View file @
2edf6482
/*
*
Copyright
(
c
)
2014
-
201
6
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2014
-
201
7
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
Redistribution
and
use
in
source
and
binary
forms
,
with
or
without
*
modification
,
are
permitted
provided
that
the
following
conditions
are
met
:
...
...
@@ -131,7 +131,7 @@ endfunc platform_set_stack
*
-------------------------------------------------------
*/
func_deprecated
platform_get_stack
#if
ASM
_ASSERTION
#if
ENABLE
_ASSERTION
S
mrs
x1
,
mpidr_el1
cmp
x0
,
x1
ASM_ASSERT
(
eq
)
...
...
@@ -150,7 +150,7 @@ endfunc_deprecated platform_get_stack
*
-----------------------------------------------------
*/
func_deprecated
platform_set_stack
#if
ASM
_ASSERTION
#if
ENABLE
_ASSERTION
S
mrs
x1
,
mpidr_el1
cmp
x0
,
x1
ASM_ASSERT
(
eq
)
...
...
Prev
1
2
Next
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