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
730495c7
Commit
730495c7
authored
Nov 18, 2020
by
Madhukar Pappireddy
Committed by
TrustedFirmware Code Review
Nov 18, 2020
Browse files
Merge "TSP: Fix GCC 11.0.0 compilation error." into integration
parents
e2c509a3
caff3c87
Changes
3
Hide whitespace changes
Inline
Side-by-side
bl32/tsp/aarch64/tsp_request.S
View file @
730495c7
/*
/*
*
Copyright
(
c
)
2013
-
20
14
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2013
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -9,28 +9,19 @@
...
@@ -9,28 +9,19 @@
.
globl
tsp_get_magic
.
globl
tsp_get_magic
/*
/*
*
This
function
raises
an
SMC
to
retrieve
arguments
from
secure
*
This
function
raises
an
SMC
to
retrieve
arguments
from
secure
*
monitor
/
dispatcher
,
saves
the
returned
arguments
the
array
received
in
x0
,
*
monitor
/
dispatcher
,
saves
the
returned
arguments
the
array
received
in
x0
,
*
and
then
returns
to
the
caller
*
and
then
returns
to
the
caller
*/
*/
func
tsp_get_magic
func
tsp_get_magic
/
*
Save
address
to
stack
*/
stp
x0
,
xzr
,
[
sp
,
#-
16
]!
/
*
Load
arguments
*/
/
*
Load
arguments
*/
ldr
w0
,
_tsp_fid_get_magic
ldr
w0
,
_tsp_fid_get_magic
/
*
Raise
SMC
*/
/
*
Raise
SMC
*/
smc
#
0
smc
#
0
/
*
Restore
address
from
stack
*/
/
*
Return
arguments
in
x1
:
x0
*/
ldp
x4
,
xzr
,
[
sp
],
#
16
/
*
Store
returned
arguments
to
the
array
*/
stp
x0
,
x1
,
[
x4
,
#
0
]
ret
ret
endfunc
tsp_get_magic
endfunc
tsp_get_magic
...
...
bl32/tsp/tsp_main.c
View file @
730495c7
/*
/*
* Copyright (c) 2013-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -363,8 +363,10 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
...
@@ -363,8 +363,10 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
uint64_t
arg6
,
uint64_t
arg6
,
uint64_t
arg7
)
uint64_t
arg7
)
{
{
uint128_t
service_args
;
uint64_t
service_arg0
;
uint64_t
service_arg1
;
uint64_t
results
[
2
];
uint64_t
results
[
2
];
uint64_t
service_args
[
2
];
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
/* Update this cpu's statistics */
/* Update this cpu's statistics */
...
@@ -387,10 +389,12 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
...
@@ -387,10 +389,12 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
results
[
1
]
=
arg2
;
results
[
1
]
=
arg2
;
/*
/*
* Request a service back from dispatcher/secure monitor.
This call
* Request a service back from dispatcher/secure monitor.
* return and thereafter resume execution
*
This call
return
s
and thereafter resume
s
execution
.
*/
*/
tsp_get_magic
(
service_args
);
service_args
=
tsp_get_magic
();
service_arg0
=
(
uint64_t
)
service_args
;
service_arg1
=
(
uint64_t
)(
service_args
>>
64U
);
#if CTX_INCLUDE_MTE_REGS
#if CTX_INCLUDE_MTE_REGS
/*
/*
...
@@ -403,20 +407,20 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
...
@@ -403,20 +407,20 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
/* Determine the function to perform based on the function ID */
/* Determine the function to perform based on the function ID */
switch
(
TSP_BARE_FID
(
func
))
{
switch
(
TSP_BARE_FID
(
func
))
{
case
TSP_ADD
:
case
TSP_ADD
:
results
[
0
]
+=
service_arg
s
[
0
]
;
results
[
0
]
+=
service_arg
0
;
results
[
1
]
+=
service_arg
s
[
1
]
;
results
[
1
]
+=
service_arg
1
;
break
;
break
;
case
TSP_SUB
:
case
TSP_SUB
:
results
[
0
]
-=
service_arg
s
[
0
]
;
results
[
0
]
-=
service_arg
0
;
results
[
1
]
-=
service_arg
s
[
1
]
;
results
[
1
]
-=
service_arg
1
;
break
;
break
;
case
TSP_MUL
:
case
TSP_MUL
:
results
[
0
]
*=
service_arg
s
[
0
]
;
results
[
0
]
*=
service_arg
0
;
results
[
1
]
*=
service_arg
s
[
1
]
;
results
[
1
]
*=
service_arg
1
;
break
;
break
;
case
TSP_DIV
:
case
TSP_DIV
:
results
[
0
]
/=
service_arg
s
[
0
]
?
service_arg
s
[
0
]
:
1
;
results
[
0
]
/=
service_arg
0
?
service_arg
0
:
1
;
results
[
1
]
/=
service_arg
s
[
1
]
?
service_arg
s
[
1
]
:
1
;
results
[
1
]
/=
service_arg
1
?
service_arg
1
:
1
;
break
;
break
;
default:
default:
break
;
break
;
...
...
bl32/tsp/tsp_private.h
View file @
730495c7
/*
/*
* Copyright (c) 2014-20
18
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2014-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -61,7 +61,7 @@ typedef struct tsp_args {
...
@@ -61,7 +61,7 @@ typedef struct tsp_args {
*/
*/
CASSERT
(
TSP_ARGS_SIZE
==
sizeof
(
tsp_args_t
),
assert_sp_args_size_mismatch
);
CASSERT
(
TSP_ARGS_SIZE
==
sizeof
(
tsp_args_t
),
assert_sp_args_size_mismatch
);
void
tsp_get_magic
(
uint64_t
args
[
4
]
);
uint128_t
tsp_get_magic
(
void
);
tsp_args_t
*
tsp_cpu_resume_main
(
uint64_t
max_off_pwrlvl
,
tsp_args_t
*
tsp_cpu_resume_main
(
uint64_t
max_off_pwrlvl
,
uint64_t
arg1
,
uint64_t
arg1
,
...
...
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