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
5b33041c
Commit
5b33041c
authored
Nov 26, 2015
by
Achin Gupta
Browse files
Merge pull request #438 from soby-mathew/sm/error_deprecate
Replace build macro WARN_DEPRECATED with ERROR_DEPRECATED
parents
4a1dcde7
7a24cba5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
5b33041c
...
@@ -87,8 +87,8 @@ TRUSTED_BOARD_BOOT := 0
...
@@ -87,8 +87,8 @@ TRUSTED_BOARD_BOOT := 0
# By default, consider that the platform's reset address is not programmable.
# By default, consider that the platform's reset address is not programmable.
# The platform Makefile is free to override this value.
# The platform Makefile is free to override this value.
PROGRAMMABLE_RESET_ADDRESS
:=
0
PROGRAMMABLE_RESET_ADDRESS
:=
0
# Build flag to
warn abou
t usage of deprecated platform and framework APIs
# Build flag to
trea
t usage of deprecated platform and framework APIs
as error.
WARN
_DEPRECATED
:=
0
ERROR
_DEPRECATED
:=
0
################################################################################
################################################################################
...
@@ -346,7 +346,7 @@ $(eval $(call assert_boolean,SAVE_KEYS))
...
@@ -346,7 +346,7 @@ $(eval $(call assert_boolean,SAVE_KEYS))
$(eval
$(call
assert_boolean,TRUSTED_BOARD_BOOT))
$(eval
$(call
assert_boolean,TRUSTED_BOARD_BOOT))
$(eval
$(call
assert_boolean,PROGRAMMABLE_RESET_ADDRESS))
$(eval
$(call
assert_boolean,PROGRAMMABLE_RESET_ADDRESS))
$(eval
$(call
assert_boolean,PSCI_EXTENDED_STATE_ID))
$(eval
$(call
assert_boolean,PSCI_EXTENDED_STATE_ID))
$(eval
$(call
assert_boolean,
WARN
_DEPRECATED))
$(eval
$(call
assert_boolean,
ERROR
_DEPRECATED))
$(eval
$(call
assert_boolean,ENABLE_PLAT_COMPAT))
$(eval
$(call
assert_boolean,ENABLE_PLAT_COMPAT))
...
@@ -368,7 +368,7 @@ $(eval $(call add_define,USE_COHERENT_MEM))
...
@@ -368,7 +368,7 @@ $(eval $(call add_define,USE_COHERENT_MEM))
$(eval
$(call
add_define,TRUSTED_BOARD_BOOT))
$(eval
$(call
add_define,TRUSTED_BOARD_BOOT))
$(eval
$(call
add_define,PROGRAMMABLE_RESET_ADDRESS))
$(eval
$(call
add_define,PROGRAMMABLE_RESET_ADDRESS))
$(eval
$(call
add_define,PSCI_EXTENDED_STATE_ID))
$(eval
$(call
add_define,PSCI_EXTENDED_STATE_ID))
$(eval
$(call
add_define,
WARN
_DEPRECATED))
$(eval
$(call
add_define,
ERROR
_DEPRECATED))
$(eval
$(call
add_define,ENABLE_PLAT_COMPAT))
$(eval
$(call
add_define,ENABLE_PLAT_COMPAT))
...
@@ -404,6 +404,11 @@ all: msg_start
...
@@ -404,6 +404,11 @@ all: msg_start
msg_start
:
msg_start
:
@
echo
"Building
${PLAT}
"
@
echo
"Building
${PLAT}
"
# Check if deprecated declarations should be treated as error or not.
ifeq
(${ERROR_DEPRECATED},0)
CFLAGS
+=
-Wno-error
=
deprecated-declarations
endif
# Expand build macros for the different images
# Expand build macros for the different images
ifeq
(${NEED_BL1},yes)
ifeq
(${NEED_BL1},yes)
$(eval
$(call
MAKE_BL,1))
$(eval
$(call
MAKE_BL,1))
...
...
bl31/context_mgmt.c
View file @
5b33041c
...
@@ -90,6 +90,14 @@ void cm_set_context_by_index(unsigned int cpu_idx, void *context,
...
@@ -90,6 +90,14 @@ void cm_set_context_by_index(unsigned int cpu_idx, void *context,
set_cpu_data_by_index
(
cpu_idx
,
cpu_context
[
security_state
],
context
);
set_cpu_data_by_index
(
cpu_idx
,
cpu_context
[
security_state
],
context
);
}
}
#if !ERROR_DEPRECATED
/*
* These context management helpers are deprecated but are maintained for use
* by SPDs which have not migrated to the new API. If ERROR_DEPRECATED
* is enabled, these are excluded from the build so as to force users to
* migrate to the new API.
*/
/*******************************************************************************
/*******************************************************************************
* This function returns a pointer to the most recent 'cpu_context' structure
* This function returns a pointer to the most recent 'cpu_context' structure
* for the CPU identified by MPIDR that was set as the context for the specified
* for the CPU identified by MPIDR that was set as the context for the specified
...
@@ -114,6 +122,21 @@ void cm_set_context_by_mpidr(uint64_t mpidr, void *context, uint32_t security_st
...
@@ -114,6 +122,21 @@ void cm_set_context_by_mpidr(uint64_t mpidr, void *context, uint32_t security_st
context
,
security_state
);
context
,
security_state
);
}
}
/*******************************************************************************
* The following function provides a compatibility function for SPDs using the
* existing cm library routines. This function is expected to be invoked for
* initializing the cpu_context for the CPU specified by MPIDR for first use.
******************************************************************************/
void
cm_init_context
(
unsigned
long
mpidr
,
const
entry_point_info_t
*
ep
)
{
if
((
mpidr
&
MPIDR_AFFINITY_MASK
)
==
(
read_mpidr_el1
()
&
MPIDR_AFFINITY_MASK
))
cm_init_my_context
(
ep
);
else
cm_init_context_by_index
(
platform_get_core_pos
(
mpidr
),
ep
);
}
#endif
/*******************************************************************************
/*******************************************************************************
* This function is used to program the context that's used for exception
* This function is used to program the context that's used for exception
* return. This initializes the SP_EL3 to a pointer to a 'cpu_context' set for
* return. This initializes the SP_EL3 to a pointer to a 'cpu_context' set for
...
@@ -260,20 +283,6 @@ void cm_init_my_context(const entry_point_info_t *ep)
...
@@ -260,20 +283,6 @@ void cm_init_my_context(const entry_point_info_t *ep)
cm_init_context_common
(
ctx
,
ep
);
cm_init_context_common
(
ctx
,
ep
);
}
}
/*******************************************************************************
* The following function provides a compatibility function for SPDs using the
* existing cm library routines. This function is expected to be invoked for
* initializing the cpu_context for the CPU specified by MPIDR for first use.
******************************************************************************/
void
cm_init_context
(
unsigned
long
mpidr
,
const
entry_point_info_t
*
ep
)
{
if
((
mpidr
&
MPIDR_AFFINITY_MASK
)
==
(
read_mpidr_el1
()
&
MPIDR_AFFINITY_MASK
))
cm_init_my_context
(
ep
);
else
cm_init_context_by_index
(
platform_get_core_pos
(
mpidr
),
ep
);
}
/*******************************************************************************
/*******************************************************************************
* Prepare the CPU system registers for first entry into secure or normal world
* Prepare the CPU system registers for first entry into secure or normal world
*
*
...
...
docs/user-guide.md
View file @
5b33041c
...
@@ -367,10 +367,10 @@ performed.
...
@@ -367,10 +367,10 @@ performed.
and it governs the return value of PSCI_FEATURES API for CPU_SUSPEND
and it governs the return value of PSCI_FEATURES API for CPU_SUSPEND
smc function id.
smc function id.
*
`
WARN
_DEPRECATED`
: This option decides whether to
warn
the usage of
*
`
ERROR
_DEPRECATED`
: This option decides whether to
treat
the usage of
deprecated platform APIs
and context management help
ers within Trusted
deprecated platform APIs
, helper functions or driv
ers within Trusted
Firmware. It can take the value 1 (
warn
the use of deprecated
APIs) or
Firmware
as error
. It can take the value 1 (
flag
the use of deprecated
0.
The default is 0.
APIs as error) or
0. The default is 0.
#### ARM development platform specific build options
#### ARM development platform specific build options
...
...
include/common/asm_macros.S
View file @
5b33041c
...
@@ -101,10 +101,10 @@
...
@@ -101,10 +101,10 @@
/
*
/
*
*
Theses
macros
are
used
to
create
function
labels
for
deprecated
*
Theses
macros
are
used
to
create
function
labels
for
deprecated
*
APIs
.
If
WARN
_DEPRECATED
is
non
zero
,
the
callers
of
these
APIs
*
APIs
.
If
ERROR
_DEPRECATED
is
non
zero
,
the
callers
of
these
APIs
*
will
fail
to
link
and
cause
build
failure
.
*
will
fail
to
link
and
cause
build
failure
.
*/
*/
#if
WARN
_DEPRECATED
#if
ERROR
_DEPRECATED
.
macro
func_deprecated
_name
.
macro
func_deprecated
_name
func
deprecated
\
_name
func
deprecated
\
_name
.
endm
.
endm
...
...
include/plat/common/common_def.h
View file @
5b33041c
...
@@ -69,15 +69,10 @@
...
@@ -69,15 +69,10 @@
/*
/*
* Macros to wrap declarations of deprecated APIs within Trusted Firmware.
* Macros to wrap declarations of deprecated APIs within Trusted Firmware.
* The callers of these APIs will continue to compile as long as the build
* The callers of these APIs will continue to compile with a warning as long
* flag WARN_DEPRECATED is zero. Else the compiler will emit a warning
* as the build flag ERROR_DEPRECATED is zero.
* when the callers of these APIs are compiled.
*/
*/
#if WARN_DEPRECATED
#define __warn_deprecated __attribute__ ((deprecated))
#define __warn_deprecated __attribute__ ((deprecated))
#else
#define __warn_deprecated
#endif
#endif
/* __COMMON_DEF_H__ */
#endif
/* __COMMON_DEF_H__ */
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