diff options
author | davidcunado-arm <david.cunado@arm.com> | 2018-03-03 13:26:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-03 13:26:18 +0000 |
commit | c37be00b160da5e8aa1a2950090fc52002d88d95 (patch) | |
tree | bb2d586ca57455118725dbc6f2d53c08fc17d04c | |
parent | 06e3a5e118eebf7575b1ae16edfeca781a4415d5 (diff) | |
parent | dcf01a0a8dddde79b8315c30395f40f9afa85af4 (diff) |
Merge pull request #1292 from danh-arm/dh/spurious-dep-warn
Suppress spurious deprecated declaration warnings
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | bl31/bl31_context_mgmt.c | 24 | ||||
-rw-r--r-- | drivers/arm/gic/v2/gicv2_main.c | 27 | ||||
-rw-r--r-- | drivers/arm/gic/v3/gicv3_main.c | 28 | ||||
-rw-r--r-- | drivers/console/aarch64/deprecated_console.S | 3 | ||||
-rw-r--r-- | include/drivers/arm/gicv2.h | 4 | ||||
-rw-r--r-- | include/drivers/arm/gicv3.h | 8 | ||||
-rw-r--r-- | include/drivers/console.h | 8 | ||||
-rw-r--r-- | make_helpers/defaults.mk | 8 | ||||
-rw-r--r-- | plat/common/aarch64/plat_common.c | 8 |
10 files changed, 109 insertions, 19 deletions
@@ -374,6 +374,12 @@ ifeq ($(HW_ASSISTED_COHERENCY)-$(USE_COHERENT_MEM),1-1) $(error USE_COHERENT_MEM cannot be enabled with HW_ASSISTED_COHERENCY) 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 ################################################################################ @@ -588,9 +594,9 @@ all: msg_start msg_start: @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) - TF_CFLAGS += -Wno-error=deprecated-declarations + CPPFLAGS += -Wno-error=deprecated-declarations -Wno-error=cpp endif # Expand build macros for the different images diff --git a/bl31/bl31_context_mgmt.c b/bl31/bl31_context_mgmt.c index 123e623c..7d2c8938 100644 --- a/bl31/bl31_context_mgmt.c +++ b/bl31/bl31_context_mgmt.c @@ -79,7 +79,13 @@ void *cm_get_context_by_mpidr(uint64_t mpidr, uint32_t 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); +#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)); + /* + * 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), 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) == (read_mpidr_el1() & MPIDR_AFFINITY_MASK)) 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); +#pragma GCC diagnostic pop + } } -#endif +#endif /* ERROR_DEPRECATED */ diff --git a/drivers/arm/gic/v2/gicv2_main.c b/drivers/arm/gic/v2/gicv2_main.c index c65f972d..7e2c7a7b 100644 --- a/drivers/arm/gic/v2/gicv2_main.c +++ b/drivers/arm/gic/v2/gicv2_main.c @@ -85,10 +85,17 @@ void gicv2_pcpu_distif_init(void) driver_data->interrupt_props_num); #if !ERROR_DEPRECATED } else { + /* + * Suppress deprecated declaration warnings in compatibility + * function + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" assert(driver_data->g0_interrupt_array); gicv2_secure_ppi_sgi_setup(driver_data->gicd_base, driver_data->g0_interrupt_num, driver_data->g0_interrupt_array); +#pragma GCC diagnostic pop } #endif @@ -128,12 +135,20 @@ void gicv2_distif_init(void) driver_data->interrupt_props_num); #if !ERROR_DEPRECATED } else { + /* + * Suppress deprecated declaration warnings in compatibility + * function + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + assert(driver_data->g0_interrupt_array); /* Configure the G0 SPIs */ gicv2_secure_spis_configure(driver_data->gicd_base, driver_data->g0_interrupt_num, driver_data->g0_interrupt_array); +#pragma GCC diagnostic pop } #endif @@ -156,6 +171,13 @@ void gicv2_driver_init(const gicv2_driver_data_t *plat_driver_data) /* Interrupt properties array size must be 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 */ 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 ? plat_driver_data->g0_interrupt_num : 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 assert(plat_driver_data->interrupt_props != NULL); diff --git a/drivers/arm/gic/v3/gicv3_main.c b/drivers/arm/gic/v3/gicv3_main.c index 45a2e5bc..f4a3ef81 100644 --- a/drivers/arm/gic/v3/gicv3_main.c +++ b/drivers/arm/gic/v3/gicv3_main.c @@ -73,6 +73,13 @@ void gicv3_driver_init(const gicv3_driver_data_t *plat_driver_data) 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 * interrupt. */ @@ -89,6 +96,11 @@ void gicv3_driver_init(const gicv3_driver_data_t *plat_driver_data) assert(plat_driver_data->g1s_interrupt_array ? plat_driver_data->g1s_interrupt_num : 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 assert(plat_driver_data->interrupt_props != NULL); @@ -189,6 +201,13 @@ void gicv3_distif_init(void) gicv3_driver_data->interrupt_props_num); #if !ERROR_DEPRECATED } 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 || gicv3_driver_data->g0_interrupt_array); @@ -209,6 +228,7 @@ void gicv3_distif_init(void) INTR_GROUP0); bitmap |= CTLR_ENABLE_G0_BIT; } +#pragma GCC diagnostic pop } #endif @@ -253,6 +273,13 @@ void gicv3_rdistif_init(unsigned int proc_num) gicv3_driver_data->interrupt_props_num); #if !ERROR_DEPRECATED } 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 || gicv3_driver_data->g0_interrupt_array); @@ -273,6 +300,7 @@ void gicv3_rdistif_init(unsigned int proc_num) INTR_GROUP0); bitmap |= CTLR_ENABLE_G0_BIT; } +#pragma GCC diagnostic pop } #endif diff --git a/drivers/console/aarch64/deprecated_console.S b/drivers/console/aarch64/deprecated_console.S index c83e2467..d6ecc4df 100644 --- a/drivers/console/aarch64/deprecated_console.S +++ b/drivers/console/aarch64/deprecated_console.S @@ -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 */ @@ -9,6 +9,7 @@ * 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. */ +#warning "Using deprecated console implementation. Please migrate to MULTI_CONSOLE_API" .globl console_init .globl console_uninit diff --git a/include/drivers/arm/gicv2.h b/include/drivers/arm/gicv2.h index 6e8322e1..39c73027 100644 --- a/include/drivers/arm/gicv2.h +++ b/include/drivers/arm/gicv2.h @@ -155,8 +155,8 @@ typedef struct gicv2_driver_data { uintptr_t gicd_base; uintptr_t gicc_base; #if !ERROR_DEPRECATED - unsigned int g0_interrupt_num; - const unsigned int *g0_interrupt_array; + unsigned int g0_interrupt_num __deprecated; + const unsigned int *g0_interrupt_array __deprecated; #endif unsigned int *target_masks; unsigned int target_masks_num; diff --git a/include/drivers/arm/gicv3.h b/include/drivers/arm/gicv3.h index 5f265c6e..37c92e4f 100644 --- a/include/drivers/arm/gicv3.h +++ b/include/drivers/arm/gicv3.h @@ -310,10 +310,10 @@ typedef struct gicv3_driver_data { uintptr_t gicd_base; uintptr_t gicr_base; #if !ERROR_DEPRECATED - unsigned int g0_interrupt_num; - unsigned int g1s_interrupt_num; - const unsigned int *g0_interrupt_array; - const unsigned int *g1s_interrupt_array; + unsigned int g0_interrupt_num __deprecated; + unsigned int g1s_interrupt_num __deprecated; + const unsigned int *g0_interrupt_array __deprecated; + const unsigned int *g1s_interrupt_array __deprecated; #endif const interrupt_prop_t *interrupt_props; unsigned int interrupt_props_num; diff --git a/include/drivers/console.h b/include/drivers/console.h index 0629f571..f8ec83d2 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -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 */ @@ -63,10 +63,10 @@ int console_getc(void); int console_flush(void); #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, - unsigned int uart_clk, unsigned int baud_rate) __deprecated; -void console_uninit(void) __deprecated; + unsigned int uart_clk, unsigned int baud_rate); +void console_uninit(void); #endif #endif /* __ASSEMBLY__ */ diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk index a80a4915..751f8343 100644 --- a/make_helpers/defaults.mk +++ b/make_helpers/defaults.mk @@ -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 # @@ -98,9 +98,9 @@ KEY_ALG := rsa # Flag to enable new version of image loading LOAD_IMAGE_V2 := 0 -# Use the new console API that allows registering more than one console instance -# at once. Use = instead of := to dynamically default to ERROR_DEPRECATED. -MULTI_CONSOLE_API = $(ERROR_DEPRECATED) +# Enable use of the console API allowing multiple consoles to be registered +# at the same time. +MULTI_CONSOLE_API := 0 # NS timer register save and restore NS_TIMER_SWITCH := 0 diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c index 080d3569..ddd29f29 100644 --- a/plat/common/aarch64/plat_common.c +++ b/plat/common/aarch64/plat_common.c @@ -65,7 +65,15 @@ unsigned int platform_core_pos_helper(unsigned long mpidr) #if !ERROR_DEPRECATED 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(); +#pragma GCC diagnostic pop assert(freq >> 32 == 0); |