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
9306f135
Commit
9306f135
authored
Jul 15, 2016
by
danh-arm
Committed by
GitHub
Jul 15, 2016
Browse files
Merge pull request #659 from soby-mathew/sm/declare_stack
Derive stack alignment from CACHE_WRITEBACK_GRANULE
parents
9ca516bb
663db206
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/common/asm_macros.S
View file @
9306f135
...
...
@@ -147,18 +147,34 @@
.
endm
#endif
/
*
*
Helper
assembler
macro
to
count
trailing
zeros
.
The
output
is
*
populated
in
the
`
TZ_COUNT
`
symbol
.
*/
.
macro
count_tz
_value
,
_tz_count
.
if
\
_value
count_tz
"(\_value >> 1)"
,
"(\_tz_count + 1)"
.
else
.
equ
TZ_COUNT
,
(
\
_tz_count
-
1
)
.
endif
.
endm
/
*
*
This
macro
declares
an
array
of
1
or
more
stacks
,
properly
*
aligned
and
in
the
requested
section
*/
#define STACK_ALIGN
6
#define
DEFAULT_
STACK_ALIGN
(1 << 6) /* In case the caller doesnt provide alignment */
.
macro
declare_stack
_name
,
_section
,
_size
,
_count
.
if
((
\
_size
&
((
1
<<
STACK_ALIGN
)
-
1
))
<>
0
)
.
macro
declare_stack
_name
,
_section
,
_size
,
_count
,
_align
=
DEFAULT_STACK_ALIGN
count_tz
\
_align
,
0
.
if
(
\
_align
-
(
1
<<
TZ_COUNT
))
.
error
"Incorrect stack alignment specified (Must be a power of 2)."
.
endif
.
if
((
\
_size
&
((
1
<<
TZ_COUNT
)
-
1
))
<>
0
)
.
error
"Stack size not correctly aligned"
.
endif
.
section
\
_section
,
"aw"
,
%
nobits
.
align
STACK_ALIGN
.
align
TZ_COUNT
\
_name
:
.
space
((
\
_count
)
*
(
\
_size
)),
0
.
endm
...
...
plat/common/aarch64/platform_mp_stack.S
View file @
9306f135
...
...
@@ -193,4 +193,5 @@ endfunc plat_set_my_stack
*
-----------------------------------------------------
*/
declare_stack
platform_normal_stacks
,
tzfw_normal_stacks
,
\
PLATFORM_STACK_SIZE
,
PLATFORM_CORE_COUNT
PLATFORM_STACK_SIZE
,
PLATFORM_CORE_COUNT
,
\
CACHE_WRITEBACK_GRANULE
plat/common/aarch64/platform_up_stack.S
View file @
9306f135
...
...
@@ -99,4 +99,4 @@ endfunc_deprecated platform_set_stack
*
-----------------------------------------------------
*/
declare_stack
platform_normal_stacks
,
tzfw_normal_stacks
,
\
PLATFORM_STACK_SIZE
,
1
PLATFORM_STACK_SIZE
,
1
,
CACHE_WRITEBACK_GRANULE
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