From patchwork Sat Jul 4 15:39:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11643857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B129A92A for ; Sat, 4 Jul 2020 15:58:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84C90206DF for ; Sat, 4 Jul 2020 15:58:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OyUOM5v4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84C90206DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrkZ7-0000bV-R2 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 04 Jul 2020 11:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrkHs-0003IY-Jy for qemu-devel@nongnu.org; Sat, 04 Jul 2020 11:41:08 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:56240 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jrkHp-0008Na-Ta for qemu-devel@nongnu.org; Sat, 04 Jul 2020 11:41:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593877265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MU7ruh/10BWYTVNZhg+Fh18ywKF1bn8cc3b/vsMMid8=; b=OyUOM5v4xDon6C7Tj9353fZmmNDOZi1Y8YYnHQ76eCF5H/SvPpLtYtJ9odC//yjmD/eMEr 72yqevAuE7QXrBESAOIMzNG0YPFqsXkW9pEm4WfER0cLWeFCQwp9qGJ9THbi5Z2WU5PoFH dyE+sEf+4DuVq0kC9jFpnZQ4ozvEhxg= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-snRgb51IM16JnwwHV7txPQ-1; Sat, 04 Jul 2020 11:41:03 -0400 X-MC-Unique: snRgb51IM16JnwwHV7txPQ-1 Received: by mail-wr1-f69.google.com with SMTP id y13so35960935wrp.13 for ; Sat, 04 Jul 2020 08:41:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MU7ruh/10BWYTVNZhg+Fh18ywKF1bn8cc3b/vsMMid8=; b=rJ7tEQCYbZoHu8skTw7TsvAWAkafNkL+qyWBILJBQDxC7Hq++ALtCTxLhtKtAk+C6r cppgcZdaDBYoi98s7iTueWqlYUZcweqknfIQm53eJDVRhwRoFOyEJujKNYx/OQ0us5l+ wIWh278Gtdgdz60PXY4lQBSX5sg4skXV6LB7muYxkaSIs14gK0PcnmNajXcCBZpqArQl eTmhojKWCL/ncqDY/AjumKYi/0zF2Qqd2A/VmefFG81yI61QZBKCVqC4Qtg99WJiBfcc 4cSyp+gW/3HE4+ZPjR8F5d9nPjYuwf42iJMWRj422akPyQZn5EtBHXZT74jS6gfDAng/ 9MNA== X-Gm-Message-State: AOAM532cYllOCTX6XbfghfComHmpiJSJ08VV386QGKqSM5vfkmsDei1Q AvrVs7WdwWfRb0JaEblWIYnZW8RDT6Xhh5EOKxaw0wPaV9Q6VHMuMD7KklzJrf7HgdIx7KvSoWc CZNuUHOf+LWV6Qgs= X-Received: by 2002:a5d:698e:: with SMTP id g14mr44409207wru.301.1593877260080; Sat, 04 Jul 2020 08:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxftjPNjUMdxjrRBqmZD6edir9YtaTKoU0Eg13XzXVSYHSv0Pt0WI+/zvIE89o3YNtuucpRKw== X-Received: by 2002:a5d:698e:: with SMTP id g14mr44409166wru.301.1593877259854; Sat, 04 Jul 2020 08:40:59 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id b62sm16727187wmh.38.2020.07.04.08.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 08:40:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 20/23] hw/sh4: Emit warning when old code is used Date: Sat, 4 Jul 2020 17:39:05 +0200 Message-Id: <20200704153908.12118-21-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200704153908.12118-1-philmd@redhat.com> References: <20200704153908.12118-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 08:57:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Sagar Karandikar , "Michael S. Tsirkin" , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Yoshinori Sato , Magnus Damm , Palmer Dabbelt , Eduardo Habkost , Alistair Francis , qemu-arm@nongnu.org, =?utf-8?q?M?= =?utf-8?q?arc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stafford Horne , David Gibson , qemu-riscv@nongnu.org, Thomas Huth , Bastian Koppelmann , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This code hasn't been QOM'ified yet. Warn the user. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sh_serial.c | 3 +++ hw/intc/sh_intc.c | 3 +++ hw/sh4/r2d.c | 3 +++ hw/sh4/sh7750.c | 4 ++++ hw/timer/sh_timer.c | 5 +++++ 5 files changed, 18 insertions(+) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 167f4d8cb9..9366a23dd2 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -31,6 +31,7 @@ #include "chardev/char-fe.h" #include "qapi/error.h" #include "qemu/timer.h" +#include "hw/qdev-deprecated.h" //#define DEBUG_SERIAL @@ -382,6 +383,8 @@ void sh_serial_init(MemoryRegion *sysmem, { sh_serial_state *s; + qdev_warn_deprecated_function_used(); + s = g_malloc0(sizeof(sh_serial_state)); s->feat = feat; diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c index 72a55e32dd..c90fbf47bb 100644 --- a/hw/intc/sh_intc.c +++ b/hw/intc/sh_intc.c @@ -13,6 +13,7 @@ #include "hw/sh4/sh_intc.h" #include "hw/irq.h" #include "hw/sh4/sh.h" +#include "hw/qdev-deprecated.h" //#define DEBUG_INTC //#define DEBUG_INTC_SOURCES @@ -444,6 +445,8 @@ int sh_intc_init(MemoryRegion *sysmem, { unsigned int i, j; + qdev_warn_deprecated_function_used(); + desc->pending = 0; desc->nr_sources = nr_sources; desc->mask_regs = mask_regs; diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 443820901d..5b4d383a86 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -43,6 +43,7 @@ #include "hw/usb.h" #include "hw/block/flash.h" #include "exec/address-spaces.h" +#include "hw/qdev-deprecated.h" #define FLASH_BASE 0x00000000 #define FLASH_SIZE (16 * MiB) @@ -187,6 +188,8 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem, { r2d_fpga_t *s; + qdev_warn_deprecated_function_used(); + s = g_malloc0(sizeof(r2d_fpga_t)); s->irl = irl; diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index f8ac3ec6e3..82549139f9 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -33,6 +33,7 @@ #include "hw/timer/tmu012.h" #include "cpu.h" #include "exec/exec-all.h" +#include "hw/qdev-deprecated.h" #define NB_DEVICES 4 @@ -757,6 +758,8 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem) { SH7750State *s; + qdev_warn_deprecated_function_used(); + s = g_malloc0(sizeof(SH7750State)); s->cpu = cpu; s->periph_freq = 60000000; /* 60MHz */ @@ -867,6 +870,7 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem) qemu_irq sh7750_irl(SH7750State *s) { + qdev_warn_deprecated_function_used(); sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */ return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0); } diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index bb0e1c8ee5..d0740b2ae6 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -15,6 +15,7 @@ #include "hw/sh4/sh.h" #include "hw/timer/tmu012.h" #include "hw/ptimer.h" +#include "hw/qdev-deprecated.h" //#define DEBUG_TIMER @@ -200,6 +201,8 @@ static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq) { sh_timer_state *s; + qdev_warn_deprecated_function_used(); + s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state)); s->freq = freq; s->feat = feat; @@ -320,6 +323,8 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, tmu012_state *s; int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0; + qdev_warn_deprecated_function_used(); + s = (tmu012_state *)g_malloc0(sizeof(tmu012_state)); s->feat = feat; s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq);