Merge pull request #1292 from danh-arm/dh/spurious-dep-warn

Suppress spurious deprecated declaration warnings
This commit is contained in:
davidcunado-arm 2018-03-03 13:26:18 +00:00 committed by GitHub
commit c37be00b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 109 additions and 19 deletions

View File

@ -374,6 +374,12 @@ ifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1)
$(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY) $(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY)
endif endif
ifneq ($(MULTI_CONSOLE_API), 0)
ifeq (${ARCH},aarch32)
$(error "Error: MULTI_CONSOLE_API is not supported for AArch32")
endif
endif
################################################################################ ################################################################################
# Process platform overrideable behaviour # Process platform overrideable behaviour
################################################################################ ################################################################################
@ -588,9 +594,9 @@ all: msg_start
msg_start: msg_start:
@echo "Building ${PLAT}" @echo "Building ${PLAT}"
# Check if deprecated declarations should be treated as error or not. # Check if deprecated declarations and cpp warnings should be treated as error or not.
ifeq (${ERROR_DEPRECATED},0) ifeq (${ERROR_DEPRECATED},0)
TF_CFLAGS += -Wno-error=deprecated-declarations CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp
endif endif
# Expand build macros for the different images # Expand build macros for the different images

View File

@ -79,7 +79,13 @@ void *cm_get_context_by_mpidr(uint64_t mpidr, uint32_t security_state)
{ {
assert(sec_state_is_valid(security_state)); assert(sec_state_is_valid(security_state));
/*
* Suppress deprecated declaration warning in compatibility function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return cm_get_context_by_index(platform_get_core_pos(mpidr), security_state); return cm_get_context_by_index(platform_get_core_pos(mpidr), security_state);
#pragma GCC diagnostic pop
} }
/******************************************************************************* /*******************************************************************************
@ -90,8 +96,14 @@ void cm_set_context_by_mpidr(uint64_t mpidr, void *context, uint32_t security_st
{ {
assert(sec_state_is_valid(security_state)); assert(sec_state_is_valid(security_state));
/*
* Suppress deprecated declaration warning in compatibility function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
cm_set_context_by_index(platform_get_core_pos(mpidr), cm_set_context_by_index(platform_get_core_pos(mpidr),
context, security_state); context, security_state);
#pragma GCC diagnostic pop
} }
/******************************************************************************* /*******************************************************************************
@ -104,7 +116,15 @@ void cm_init_context(uint64_t mpidr, const entry_point_info_t *ep)
if ((mpidr & MPIDR_AFFINITY_MASK) == if ((mpidr & MPIDR_AFFINITY_MASK) ==
(read_mpidr_el1() & MPIDR_AFFINITY_MASK)) (read_mpidr_el1() & MPIDR_AFFINITY_MASK))
cm_init_my_context(ep); cm_init_my_context(ep);
else else {
/*
* Suppress deprecated declaration warning in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
cm_init_context_by_index(platform_get_core_pos(mpidr), ep); cm_init_context_by_index(platform_get_core_pos(mpidr), ep);
#pragma GCC diagnostic pop
}
} }
#endif #endif /* ERROR_DEPRECATED */

View File

@ -85,10 +85,17 @@ void gicv2_pcpu_distif_init(void)
driver_data->interrupt_props_num); driver_data->interrupt_props_num);
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
} else { } else {
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
assert(driver_data->g0_interrupt_array); assert(driver_data->g0_interrupt_array);
gicv2_secure_ppi_sgi_setup(driver_data->gicd_base, gicv2_secure_ppi_sgi_setup(driver_data->gicd_base,
driver_data->g0_interrupt_num, driver_data->g0_interrupt_num,
driver_data->g0_interrupt_array); driver_data->g0_interrupt_array);
#pragma GCC diagnostic pop
} }
#endif #endif
@ -128,12 +135,20 @@ void gicv2_distif_init(void)
driver_data->interrupt_props_num); driver_data->interrupt_props_num);
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
} else { } else {
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
assert(driver_data->g0_interrupt_array); assert(driver_data->g0_interrupt_array);
/* Configure the G0 SPIs */ /* Configure the G0 SPIs */
gicv2_secure_spis_configure(driver_data->gicd_base, gicv2_secure_spis_configure(driver_data->gicd_base,
driver_data->g0_interrupt_num, driver_data->g0_interrupt_num,
driver_data->g0_interrupt_array); driver_data->g0_interrupt_array);
#pragma GCC diagnostic pop
} }
#endif #endif
@ -156,6 +171,13 @@ void gicv2_driver_init(const gicv2_driver_data_t *plat_driver_data)
/* Interrupt properties array size must be 0 */ /* Interrupt properties array size must be 0 */
assert(plat_driver_data->interrupt_props_num == 0); assert(plat_driver_data->interrupt_props_num == 0);
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/* The platform should provide a list of secure interrupts */ /* The platform should provide a list of secure interrupts */
assert(plat_driver_data->g0_interrupt_array); assert(plat_driver_data->g0_interrupt_array);
@ -166,6 +188,11 @@ void gicv2_driver_init(const gicv2_driver_data_t *plat_driver_data)
assert(plat_driver_data->g0_interrupt_array ? assert(plat_driver_data->g0_interrupt_array ?
plat_driver_data->g0_interrupt_num : plat_driver_data->g0_interrupt_num :
plat_driver_data->g0_interrupt_num == 0); plat_driver_data->g0_interrupt_num == 0);
#pragma GCC diagnostic pop
WARN("Using deprecated integer interrupt array in "
"gicv2_driver_data_t\n");
WARN("Please migrate to using an interrupt_prop_t array\n");
} }
#else #else
assert(plat_driver_data->interrupt_props != NULL); assert(plat_driver_data->interrupt_props != NULL);

View File

@ -72,6 +72,13 @@ void gicv3_driver_init(const gicv3_driver_data_t *plat_driver_data)
/* Interrupt properties array size must be 0 */ /* Interrupt properties array size must be 0 */
assert(plat_driver_data->interrupt_props_num == 0); assert(plat_driver_data->interrupt_props_num == 0);
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/* /*
* The platform should provide a list of at least one type of * The platform should provide a list of at least one type of
* interrupt. * interrupt.
@ -89,6 +96,11 @@ void gicv3_driver_init(const gicv3_driver_data_t *plat_driver_data)
assert(plat_driver_data->g1s_interrupt_array ? assert(plat_driver_data->g1s_interrupt_array ?
plat_driver_data->g1s_interrupt_num : plat_driver_data->g1s_interrupt_num :
plat_driver_data->g1s_interrupt_num == 0); plat_driver_data->g1s_interrupt_num == 0);
#pragma GCC diagnostic pop
WARN("Using deprecated integer interrupt arrays in "
"gicv3_driver_data_t\n");
WARN("Please migrate to using interrupt_prop_t arrays\n");
} }
#else #else
assert(plat_driver_data->interrupt_props != NULL); assert(plat_driver_data->interrupt_props != NULL);
@ -189,6 +201,13 @@ void gicv3_distif_init(void)
gicv3_driver_data->interrupt_props_num); gicv3_driver_data->interrupt_props_num);
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
} else { } else {
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
assert(gicv3_driver_data->g1s_interrupt_array || assert(gicv3_driver_data->g1s_interrupt_array ||
gicv3_driver_data->g0_interrupt_array); gicv3_driver_data->g0_interrupt_array);
@ -209,6 +228,7 @@ void gicv3_distif_init(void)
INTR_GROUP0); INTR_GROUP0);
bitmap |= CTLR_ENABLE_G0_BIT; bitmap |= CTLR_ENABLE_G0_BIT;
} }
#pragma GCC diagnostic pop
} }
#endif #endif
@ -253,6 +273,13 @@ void gicv3_rdistif_init(unsigned int proc_num)
gicv3_driver_data->interrupt_props_num); gicv3_driver_data->interrupt_props_num);
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
} else { } else {
/*
* Suppress deprecated declaration warnings in compatibility
* function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
assert(gicv3_driver_data->g1s_interrupt_array || assert(gicv3_driver_data->g1s_interrupt_array ||
gicv3_driver_data->g0_interrupt_array); gicv3_driver_data->g0_interrupt_array);
@ -273,6 +300,7 @@ void gicv3_rdistif_init(unsigned int proc_num)
INTR_GROUP0); INTR_GROUP0);
bitmap |= CTLR_ENABLE_G0_BIT; bitmap |= CTLR_ENABLE_G0_BIT;
} }
#pragma GCC diagnostic pop
} }
#endif #endif

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -9,6 +9,7 @@
* This is the common console core code for the deprecated single-console API. * This is the common console core code for the deprecated single-console API.
* New platforms should set MULTI_CONSOLE_API=1 and not use this file. * New platforms should set MULTI_CONSOLE_API=1 and not use this file.
*/ */
#warning "Using deprecated console implementation. Please migrate to MULTI_CONSOLE_API"
.globl console_init .globl console_init
.globl console_uninit .globl console_uninit

View File

@ -155,8 +155,8 @@ typedef struct gicv2_driver_data {
uintptr_t gicd_base; uintptr_t gicd_base;
uintptr_t gicc_base; uintptr_t gicc_base;
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
unsigned int g0_interrupt_num; unsigned int g0_interrupt_num __deprecated;
const unsigned int *g0_interrupt_array; const unsigned int *g0_interrupt_array __deprecated;
#endif #endif
unsigned int *target_masks; unsigned int *target_masks;
unsigned int target_masks_num; unsigned int target_masks_num;

View File

@ -310,10 +310,10 @@ typedef struct gicv3_driver_data {
uintptr_t gicd_base; uintptr_t gicd_base;
uintptr_t gicr_base; uintptr_t gicr_base;
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
unsigned int g0_interrupt_num; unsigned int g0_interrupt_num __deprecated;
unsigned int g1s_interrupt_num; unsigned int g1s_interrupt_num __deprecated;
const unsigned int *g0_interrupt_array; const unsigned int *g0_interrupt_array __deprecated;
const unsigned int *g1s_interrupt_array; const unsigned int *g1s_interrupt_array __deprecated;
#endif #endif
const interrupt_prop_t *interrupt_props; const interrupt_prop_t *interrupt_props;
unsigned int interrupt_props_num; unsigned int interrupt_props_num;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -63,10 +63,10 @@ int console_getc(void);
int console_flush(void); int console_flush(void);
#if !MULTI_CONSOLE_API #if !MULTI_CONSOLE_API
/* DEPRECATED on AArch64 -- use console_<driver>_register() instead! */ /* REMOVED on AArch64 -- use console_<driver>_register() instead! */
int console_init(uintptr_t base_addr, int console_init(uintptr_t base_addr,
unsigned int uart_clk, unsigned int baud_rate) __deprecated; unsigned int uart_clk, unsigned int baud_rate);
void console_uninit(void) __deprecated; void console_uninit(void);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. # Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -98,9 +98,9 @@ KEY_ALG := rsa
# Flag to enable new version of image loading # Flag to enable new version of image loading
LOAD_IMAGE_V2 := 0 LOAD_IMAGE_V2 := 0
# Use the new console API that allows registering more than one console instance # Enable use of the console API allowing multiple consoles to be registered
# at once. Use = instead of := to dynamically default to ERROR_DEPRECATED. # at the same time.
MULTI_CONSOLE_API = $(ERROR_DEPRECATED) MULTI_CONSOLE_API := 0
# NS timer register save and restore # NS timer register save and restore
NS_TIMER_SWITCH := 0 NS_TIMER_SWITCH := 0

View File

@ -65,7 +65,15 @@ unsigned int platform_core_pos_helper(unsigned long mpidr)
#if !ERROR_DEPRECATED #if !ERROR_DEPRECATED
unsigned int plat_get_syscnt_freq2(void) unsigned int plat_get_syscnt_freq2(void)
{ {
WARN("plat_get_syscnt_freq() is deprecated\n");
WARN("Please define plat_get_syscnt_freq2()\n");
/*
* Suppress deprecated declaration warning in compatibility function
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
unsigned long long freq = plat_get_syscnt_freq(); unsigned long long freq = plat_get_syscnt_freq();
#pragma GCC diagnostic pop
assert(freq >> 32 == 0); assert(freq >> 32 == 0);