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
413115e1
Commit
413115e1
authored
Sep 07, 2017
by
davidcunado-arm
Committed by
GitHub
Sep 07, 2017
Browse files
Merge pull request #1019 from etienne-lms/log-size
CPU_DATA_LOG2SIZE depends on cache line size
parents
e524d78f
86606eb5
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/common/aarch32/asm_macros.S
View file @
413115e1
...
...
@@ -79,6 +79,19 @@
ldr
r0
,
=(
\
_name
+
\
_size
)
.
endm
/
*
*
Helper
macro
to
generate
the
best
mov
/
movw
/
movt
combinations
*
according
to
the
value
to
be
moved
.
*/
.
macro
mov_imm
_reg
,
_val
.
if
((
\
_val
)
&
0xffff0000
)
==
0
mov
\
_reg
,
#(
\
_val
)
.
else
movw
\
_reg
,
#((
\
_val
)
&
0xffff
)
movt
\
_reg
,
#((
\
_val
)
>>
16
)
.
endif
.
endm
/
*
*
Macro
to
mark
instances
where
we
're jumping to a function and don'
t
*
expect
a
return
.
To
provide
the
function
being
jumped
to
with
...
...
include/lib/el3_runtime/cpu_data.h
View file @
413115e1
...
...
@@ -7,12 +7,15 @@
#ifndef __CPU_DATA_H__
#define __CPU_DATA_H__
#include <platform_def.h>
/* CACHE_WRITEBACK_GRANULE required */
#ifdef AARCH32
#if CRASH_REPORTING
#error "Crash reporting is not supported in AArch32"
#endif
#define CPU_DATA_CPU_OPS_PTR 0x0
#define CPU_DATA_CRASH_BUF_OFFSET 0x4
#else
/* AARCH32 */
...
...
@@ -25,14 +28,18 @@
#endif
/* AARCH32 */
#if CRASH_REPORTING
#define CPU_DATA_LOG2SIZE 7
#define CPU_DATA_CRASH_BUF_END (CPU_DATA_CRASH_BUF_OFFSET + \
CPU_DATA_CRASH_BUF_SIZE)
#else
#define CPU_DATA_LOG2SIZE 6
#define CPU_DATA_CRASH_BUF_END CPU_DATA_CRASH_BUF_OFFSET
#endif
/* cpu_data size is the data size rounded up to the platform cache line size */
#define CPU_DATA_SIZE (((CPU_DATA_CRASH_BUF_END + \
CACHE_WRITEBACK_GRANULE - 1) / \
CACHE_WRITEBACK_GRANULE) * \
CACHE_WRITEBACK_GRANULE)
#if ENABLE_RUNTIME_INSTRUMENTATION
/* Temporary space to store PMF timestamps from assembly code */
#define CPU_DATA_PMF_TS_COUNT 1
...
...
@@ -98,8 +105,8 @@ CASSERT(CPU_DATA_CRASH_BUF_OFFSET == __builtin_offsetof
assert_cpu_data_crash_stack_offset_mismatch
);
#endif
CASSERT
(
(
1
<<
CPU_DATA_
LOG2
SIZE
)
==
sizeof
(
cpu_data_t
),
assert_cpu_data_
log2
size_mismatch
);
CASSERT
(
CPU_DATA_SIZE
==
sizeof
(
cpu_data_t
),
assert_cpu_data_size_mismatch
);
CASSERT
(
CPU_DATA_CPU_OPS_PTR
==
__builtin_offsetof
(
cpu_data_t
,
cpu_ops_ptr
),
...
...
lib/el3_runtime/aarch32/cpu_data.S
View file @
413115e1
...
...
@@ -34,7 +34,9 @@ endfunc _cpu_data
*
-----------------------------------------------------------------
*/
func
_cpu_data_by_index
mov_imm
r1
,
CPU_DATA_SIZE
mul
r0
,
r0
,
r1
ldr
r1
,
=
percpu_data
add
r0
,
r
1
,
r0
,
LSL
#
CPU_DATA_LOG2SIZE
add
r0
,
r
0
,
r1
bx
lr
endfunc
_cpu_data_by_index
lib/el3_runtime/aarch64/cpu_data.S
View file @
413115e1
...
...
@@ -39,7 +39,9 @@ endfunc init_cpu_data_ptr
*
-----------------------------------------------------------------
*/
func
_cpu_data_by_index
mov_imm
x1
,
CPU_DATA_SIZE
mul
x0
,
x0
,
x1
adr
x1
,
percpu_data
add
x0
,
x
1
,
x0
,
LSL
#
CPU_DATA_LOG2SIZE
add
x0
,
x
0
,
x1
ret
endfunc
_cpu_data_by_index
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