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
4e2887f2
Commit
4e2887f2
authored
May 08, 2020
by
Mark Dykes
Committed by
TrustedFirmware Code Review
May 08, 2020
Browse files
Merge "Fix SMCCC_ARCH_SOC_ID implementation" into integration
parents
7bf5832c
a718c3d6
Changes
1
Show whitespace changes
Inline
Side-by-side
services/arm_arch_svc/arm_arch_svc_setup.c
View file @
4e2887f2
...
...
@@ -19,20 +19,13 @@ static int32_t smccc_version(void)
return
MAKE_SMCCC_VERSION
(
SMCCC_MAJOR_VERSION
,
SMCCC_MINOR_VERSION
);
}
static
int32_t
smccc_arch_features
(
u_register_t
arg1
,
u_register_t
arg2
)
static
int32_t
smccc_arch_features
(
u_register_t
arg1
)
{
switch
(
arg1
)
{
case
SMCCC_VERSION
:
case
SMCCC_ARCH_FEATURES
:
return
SMC_OK
;
case
SMCCC_ARCH_SOC_ID
:
if
(
arg2
==
SMCCC_GET_SOC_REVISION
)
{
return
plat_get_soc_revision
();
}
if
(
arg2
==
SMCCC_GET_SOC_VERSION
)
{
return
plat_get_soc_version
();
}
return
SMC_ARCH_CALL_INVAL_PARAM
;
return
SMC_OK
;
#if WORKAROUND_CVE_2017_5715
case
SMCCC_ARCH_WORKAROUND_1
:
if
(
check_wa_cve_2017_5715
()
==
ERRATA_NOT_APPLIES
)
...
...
@@ -87,6 +80,19 @@ static int32_t smccc_arch_features(u_register_t arg1, u_register_t arg2)
}
}
/* return soc revision or soc version on success otherwise
* return invalid parameter */
static
int32_t
smccc_arch_id
(
u_register_t
arg1
)
{
if
(
arg1
==
SMCCC_GET_SOC_REVISION
)
{
return
plat_get_soc_revision
();
}
if
(
arg1
==
SMCCC_GET_SOC_VERSION
)
{
return
plat_get_soc_version
();
}
return
SMC_ARCH_CALL_INVAL_PARAM
;
}
/*
* Top-level Arm Architectural Service SMC handler.
*/
...
...
@@ -103,7 +109,9 @@ static uintptr_t arm_arch_svc_smc_handler(uint32_t smc_fid,
case
SMCCC_VERSION
:
SMC_RET1
(
handle
,
smccc_version
());
case
SMCCC_ARCH_FEATURES
:
SMC_RET1
(
handle
,
smccc_arch_features
(
x1
,
x2
));
SMC_RET1
(
handle
,
smccc_arch_features
(
x1
));
case
SMCCC_ARCH_SOC_ID
:
SMC_RET1
(
handle
,
smccc_arch_id
(
x1
));
#if WORKAROUND_CVE_2017_5715
case
SMCCC_ARCH_WORKAROUND_1
:
/*
...
...
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