From bc1a03c7a6db40a1ab86192675aa47d17afb7f4c Mon Sep 17 00:00:00 2001 From: Dan Handley Date: Tue, 27 Feb 2018 16:03:58 +0000 Subject: Improve MULTI_CONSOLE_API deprecation warnings For platforms that have not migrated to MULTI_CONSOLE_API == 1, there are a lot of confusing deprecated declaration warnings relating to use of console_init() and console_uninit(). Some of these relate to use by the generic code, not the platform code. These functions are not really deprecated but *removed* when MULTI_CONSOLE_API == 1. This patch consolidates these warnings into a single preprocessor warning. The __deprecated attribute is removed from the console_init() and console_uninit() declarations. For preprocessor warnings like this to not cause fatal build errors, this patch adds -Wno-error=cpp to the build flags when ERROR_DEPRECATED == 0. This option (and -Wno-error=deprecated-declarations) is now added to CPPFLAGS instead of TF_CFLAGS to ensure the build flags are used in the assembler as well as the compiler. This patch also disentangles the MULTI_CONSOLE_API and ERROR_DEPRECATED build flags by defaulting MULTI_CONSOLE_API to 0 instead of ERROR_DEPRECATED. This allows platforms that have not migrated to MULTI_CONSOLE_API to use ERROR_DEPRECATED == 1 to emit a more meaningful build error. Finally, this patch bans use of MULTI_CONSOLE_API == 1 and AARCH32, since the AArch32 console implementation does not support MULTI_CONSOLE_API == 1. Change-Id: If762165ddcb90c28aa7a4951aba70cb15c2b709c Signed-off-by: Dan Handley --- include/drivers/console.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/drivers/console.h b/include/drivers/console.h index 0629f5717..f8ec83d2f 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__register() instead! */ +/* REMOVED on AArch64 -- use console__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__ */ -- cgit v1.2.3 From dcf01a0a8dddde79b8315c30395f40f9afa85af4 Mon Sep 17 00:00:00 2001 From: Dan Handley Date: Thu, 1 Mar 2018 16:00:15 +0000 Subject: Emit warnings when using deprecated GIC init Emit runtime warnings when intializing the GIC drivers using the deprecated method of defining integer interrupt arrays in the GIC driver data structures; interrupt_prop_t arrays should be used instead. This helps platforms detect that they have migration work to do. Previously, no warning was emitted in this case. This affects both the GICv2 and GICv3 drivers. Also use the __deprecated attribute to emit a build time warning if these deprecated fields are used. These warnings are suppressed in the GIC driver compatibility functions but will be visible if platforms use them. Change-Id: I6b6b8f6c3b4920c448b6dcb82fc18442cfdf6c7a Signed-off-by: Dan Handley --- include/drivers/arm/gicv2.h | 4 ++-- include/drivers/arm/gicv3.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/drivers/arm/gicv2.h b/include/drivers/arm/gicv2.h index 6e8322e1b..39c73027e 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 5f265c6e4..37c92e4f8 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; -- cgit v1.2.3