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
74a44dca
Unverified
Commit
74a44dca
authored
Jun 13, 2018
by
Dimitris Papastamos
Committed by
GitHub
Jun 13, 2018
Browse files
Merge pull request #1399 from danielboulby-arm/db/MISRA
MISRA 5.1, 5.3 & 5.7 compliance changes
parents
e109b0ff
776ff52a
Changes
23
Hide whitespace changes
Inline
Side-by-side
services/spd/opteed/opteed_pm.c
View file @
74a44dca
...
@@ -30,11 +30,11 @@ static int32_t opteed_cpu_off_handler(u_register_t unused)
...
@@ -30,11 +30,11 @@ static int32_t opteed_cpu_off_handler(u_register_t unused)
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
/* Program the entry point and enter OPTEE */
/* Program the entry point and enter OPTEE */
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
s
->
cpu_off_entry
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
_table
->
cpu_off_entry
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
/*
/*
...
@@ -63,11 +63,11 @@ static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl)
...
@@ -63,11 +63,11 @@ static void opteed_cpu_suspend_handler(u_register_t max_off_pwrlvl)
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
/* Program the entry point and enter OPTEE */
/* Program the entry point and enter OPTEE */
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
s
->
cpu_suspend_entry
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
_table
->
cpu_suspend_entry
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
/*
/*
...
@@ -94,11 +94,11 @@ static void opteed_cpu_on_finish_handler(u_register_t unused)
...
@@ -94,11 +94,11 @@ static void opteed_cpu_on_finish_handler(u_register_t unused)
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
entry_point_info_t
optee_on_entrypoint
;
entry_point_info_t
optee_on_entrypoint
;
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_OFF
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_OFF
);
opteed_init_optee_ep_state
(
&
optee_on_entrypoint
,
opteed_rw
,
opteed_init_optee_ep_state
(
&
optee_on_entrypoint
,
opteed_rw
,
(
uint64_t
)
&
optee_vector
s
->
cpu_on_entry
,
(
uint64_t
)
&
optee_vector
_table
->
cpu_on_entry
,
0
,
0
,
0
,
optee_ctx
);
0
,
0
,
0
,
optee_ctx
);
/* Initialise this cpu's secure context */
/* Initialise this cpu's secure context */
...
@@ -129,14 +129,14 @@ static void opteed_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl)
...
@@ -129,14 +129,14 @@ static void opteed_cpu_suspend_finish_handler(u_register_t max_off_pwrlvl)
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_SUSPEND
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_SUSPEND
);
/* Program the entry point, max_off_pwrlvl and enter the SP */
/* Program the entry point, max_off_pwrlvl and enter the SP */
write_ctx_reg
(
get_gpregs_ctx
(
&
optee_ctx
->
cpu_ctx
),
write_ctx_reg
(
get_gpregs_ctx
(
&
optee_ctx
->
cpu_ctx
),
CTX_GPREG_X0
,
CTX_GPREG_X0
,
max_off_pwrlvl
);
max_off_pwrlvl
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
s
->
cpu_resume_entry
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
_table
->
cpu_resume_entry
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
rc
=
opteed_synchronous_sp_entry
(
optee_ctx
);
/*
/*
...
@@ -168,11 +168,11 @@ static void opteed_system_off(void)
...
@@ -168,11 +168,11 @@ static void opteed_system_off(void)
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
/* Program the entry point */
/* Program the entry point */
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
s
->
system_off_entry
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
_table
->
system_off_entry
);
/* Enter OPTEE. We do not care about the return value because we
/* Enter OPTEE. We do not care about the return value because we
* must continue the shutdown anyway */
* must continue the shutdown anyway */
...
@@ -188,11 +188,11 @@ static void opteed_system_reset(void)
...
@@ -188,11 +188,11 @@ static void opteed_system_reset(void)
uint32_t
linear_id
=
plat_my_core_pos
();
uint32_t
linear_id
=
plat_my_core_pos
();
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
optee_context_t
*
optee_ctx
=
&
opteed_sp_context
[
linear_id
];
assert
(
optee_vector
s
);
assert
(
optee_vector
_table
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
assert
(
get_optee_pstate
(
optee_ctx
->
state
)
==
OPTEE_PSTATE_ON
);
/* Program the entry point */
/* Program the entry point */
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
s
->
system_reset_entry
);
cm_set_elr_el3
(
SECURE
,
(
uint64_t
)
&
optee_vector
_table
->
system_reset_entry
);
/* Enter OPTEE. We do not care about the return value because we
/* Enter OPTEE. We do not care about the return value because we
* must continue the reset anyway */
* must continue the reset anyway */
...
...
services/spd/opteed/opteed_private.h
View file @
74a44dca
...
@@ -154,7 +154,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_ep,
...
@@ -154,7 +154,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_ep,
extern
optee_context_t
opteed_sp_context
[
OPTEED_CORE_COUNT
];
extern
optee_context_t
opteed_sp_context
[
OPTEED_CORE_COUNT
];
extern
uint32_t
opteed_rw
;
extern
uint32_t
opteed_rw
;
extern
struct
optee_vectors
*
optee_vector
s
;
extern
struct
optee_vectors
*
optee_vector
_table
;
#endif
/*__ASSEMBLY__*/
#endif
/*__ASSEMBLY__*/
#endif
/* __OPTEED_PRIVATE_H__ */
#endif
/* __OPTEED_PRIVATE_H__ */
services/spd/tspd/tspd_private.h
View file @
74a44dca
...
@@ -190,14 +190,14 @@ typedef struct tsp_context {
...
@@ -190,14 +190,14 @@ typedef struct tsp_context {
}
tsp_context_t
;
}
tsp_context_t
;
/* Helper macros to store and retrieve tsp args from tsp_context */
/* Helper macros to store and retrieve tsp args from tsp_context */
#define store_tsp_args(tsp_ctx, x1, x2) do {\
#define store_tsp_args(
_
tsp_ctx,
_
x1,
_
x2) do {\
tsp_ctx->saved_tsp_args[0] = x1;\
_
tsp_ctx->saved_tsp_args[0] =
_
x1;\
tsp_ctx->saved_tsp_args[1] = x2;\
_
tsp_ctx->saved_tsp_args[1] =
_
x2;\
} while (0)
} while (0)
#define get_tsp_args(tsp_ctx, x1, x2) do {\
#define get_tsp_args(
_
tsp_ctx,
_
x1,
_
x2) do {\
x1 = tsp_ctx->saved_tsp_args[0];\
_
x1 =
_
tsp_ctx->saved_tsp_args[0];\
x2 = tsp_ctx->saved_tsp_args[1];\
_
x2 =
_
tsp_ctx->saved_tsp_args[1];\
} while (0)
} while (0)
/* TSPD power management handlers */
/* TSPD power management handlers */
...
...
Prev
1
2
Next
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