Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
5f7956c0
Commit
5f7956c0
authored
5 years ago
by
Soby Mathew
Committed by
TrustedFirmware Code Review
5 years ago
Browse files
Options
Download
Plain Diff
Merge "Unify type of "cpu_idx" across PSCI module." into integration
parents
19d15b40
fc81021a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/psci/psci_common.c
+9
-8
lib/psci/psci_common.c
lib/psci/psci_private.h
+10
-9
lib/psci/psci_private.h
with
19 additions
and
17 deletions
+19
-17
lib/psci/psci_common.c
View file @
5f7956c0
...
...
@@ -159,9 +159,10 @@ void psci_query_sys_suspend_pwrstate(psci_power_state_t *state_info)
******************************************************************************/
unsigned
int
psci_is_last_on_cpu
(
void
)
{
int
cpu_idx
,
my_idx
=
(
int
)
plat_my_core_pos
();
unsigned
int
cpu_idx
,
my_idx
=
plat_my_core_pos
();
for
(
cpu_idx
=
0
;
cpu_idx
<
PLATFORM_CORE_COUNT
;
cpu_idx
++
)
{
for
(
cpu_idx
=
0
;
cpu_idx
<
(
unsigned
int
)
PLATFORM_CORE_COUNT
;
cpu_idx
++
)
{
if
(
cpu_idx
==
my_idx
)
{
assert
(
psci_get_aff_info_state
()
==
AFF_STATE_ON
);
continue
;
...
...
@@ -206,7 +207,7 @@ static void psci_set_req_local_pwr_state(unsigned int pwrlvl,
{
assert
(
pwrlvl
>
PSCI_CPU_PWR_LVL
);
if
((
pwrlvl
>
PSCI_CPU_PWR_LVL
)
&&
(
pwrlvl
<=
PLAT_MAX_PWR_LVL
)
&&
(
cpu_idx
<
PLATFORM_CORE_COUNT
))
{
(
cpu_idx
<
(
unsigned
int
)
PLATFORM_CORE_COUNT
))
{
psci_req_local_pwr_states
[
pwrlvl
-
1U
][
cpu_idx
]
=
req_pwr_state
;
}
}
...
...
@@ -237,12 +238,12 @@ void __init psci_init_req_local_pwr_states(void)
* assertion is added to prevent us from accessing the CPU power level.
*****************************************************************************/
static
plat_local_state_t
*
psci_get_req_local_pwr_states
(
unsigned
int
pwrlvl
,
int
cpu_idx
)
unsigned
int
cpu_idx
)
{
assert
(
pwrlvl
>
PSCI_CPU_PWR_LVL
);
if
((
pwrlvl
>
PSCI_CPU_PWR_LVL
)
&&
(
pwrlvl
<=
PLAT_MAX_PWR_LVL
)
&&
(
cpu_idx
<
PLATFORM_CORE_COUNT
))
{
(
cpu_idx
<
(
unsigned
int
)
PLATFORM_CORE_COUNT
))
{
return
&
psci_req_local_pwr_states
[
pwrlvl
-
1U
][
cpu_idx
];
}
else
return
NULL
;
...
...
@@ -351,7 +352,7 @@ static void psci_set_target_local_pwr_states(unsigned int end_pwrlvl,
/*******************************************************************************
* PSCI helper function to get the parent nodes corresponding to a cpu_index.
******************************************************************************/
void
psci_get_parent_pwr_domain_nodes
(
int
cpu_idx
,
void
psci_get_parent_pwr_domain_nodes
(
unsigned
int
cpu_idx
,
unsigned
int
end_lvl
,
unsigned
int
*
node_index
)
{
...
...
@@ -417,7 +418,7 @@ void psci_do_state_coordination(unsigned int end_pwrlvl,
psci_power_state_t
*
state_info
)
{
unsigned
int
lvl
,
parent_idx
,
cpu_idx
=
plat_my_core_pos
();
int
start_idx
;
unsigned
int
start_idx
;
unsigned
int
ncpus
;
plat_local_state_t
target_state
,
*
req_states
;
...
...
@@ -763,7 +764,7 @@ int psci_validate_entry_point(entry_point_info_t *ep,
void
psci_warmboot_entrypoint
(
void
)
{
unsigned
int
end_pwrlvl
;
int
cpu_idx
=
(
int
)
plat_my_core_pos
();
unsigned
int
cpu_idx
=
plat_my_core_pos
();
unsigned
int
parent_nodes
[
PLAT_MAX_PWR_LVL
]
=
{
0
};
psci_power_state_t
state_info
=
{
{
PSCI_LOCAL_STATE_RUN
}
};
...
...
This diff is collapsed.
Click to expand it.
lib/psci/psci_private.h
View file @
5f7956c0
/*
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
9
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -55,16 +55,16 @@ static inline aff_info_state_t psci_get_aff_info_state(void)
return
get_cpu_data
(
psci_svc_cpu_data
.
aff_info_state
);
}
static
inline
aff_info_state_t
psci_get_aff_info_state_by_idx
(
int
idx
)
static
inline
aff_info_state_t
psci_get_aff_info_state_by_idx
(
unsigned
int
idx
)
{
return
get_cpu_data_by_index
(
(
unsigned
int
)
idx
,
return
get_cpu_data_by_index
(
idx
,
psci_svc_cpu_data
.
aff_info_state
);
}
static
inline
void
psci_set_aff_info_state_by_idx
(
int
idx
,
static
inline
void
psci_set_aff_info_state_by_idx
(
unsigned
int
idx
,
aff_info_state_t
aff_state
)
{
set_cpu_data_by_index
(
(
unsigned
int
)
idx
,
set_cpu_data_by_index
(
idx
,
psci_svc_cpu_data
.
aff_info_state
,
aff_state
);
}
...
...
@@ -88,9 +88,10 @@ static inline plat_local_state_t psci_get_cpu_local_state(void)
return
get_cpu_data
(
psci_svc_cpu_data
.
local_state
);
}
static
inline
plat_local_state_t
psci_get_cpu_local_state_by_idx
(
int
idx
)
static
inline
plat_local_state_t
psci_get_cpu_local_state_by_idx
(
unsigned
int
idx
)
{
return
get_cpu_data_by_index
(
(
unsigned
int
)
idx
,
return
get_cpu_data_by_index
(
idx
,
psci_svc_cpu_data
.
local_state
);
}
...
...
@@ -113,7 +114,7 @@ typedef struct non_cpu_pwr_domain_node {
* Index of the first CPU power domain node level 0 which has this node
* as its parent.
*/
int
cpu_start_idx
;
unsigned
int
cpu_start_idx
;
/*
* Number of CPU power domains which are siblings of the domain indexed
...
...
@@ -269,7 +270,7 @@ void psci_get_target_local_pwr_states(unsigned int end_pwrlvl,
psci_power_state_t
*
target_state
);
int
psci_validate_entry_point
(
entry_point_info_t
*
ep
,
uintptr_t
entrypoint
,
u_register_t
context_id
);
void
psci_get_parent_pwr_domain_nodes
(
int
cpu_idx
,
void
psci_get_parent_pwr_domain_nodes
(
unsigned
int
cpu_idx
,
unsigned
int
end_lvl
,
unsigned
int
*
node_index
);
void
psci_do_state_coordination
(
unsigned
int
end_pwrlvl
,
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help