From patchwork Sun Oct 11 19:32:20 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: 303151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28134C433E7 for ; Sun, 11 Oct 2020 19:36:27 +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 B25412083B for ; Sun, 11 Oct 2020 19:36:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NcaMislM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B25412083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRh8n-0007Zd-Q5 for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:36:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5H-000296-Ar; Sun, 11 Oct 2020 15:32:43 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5F-0006qV-RK; Sun, 11 Oct 2020 15:32:43 -0400 Received: by mail-wr1-x441.google.com with SMTP id e18so16555098wrw.9; Sun, 11 Oct 2020 12:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fmlcfpwvQZt/h1AszpZppC7oD9iO0g2rLKUxf53gOoA=; b=NcaMislMSa6o2M9nrk/84IKWm5dGHuZv+nc/Y5349o6NNgIRrLhaJECEb9XqbZy/iP FJEBH+1yHoPomXvovucwcoHXfyV5MAEe8PtZ9xIevsX6JRO7zY2dJI8QCSE2gZfDQvVf 0LV3Xn7cffiBCxI2nPjyRsXlb1taDc4uo03PGy5bQXNIHUJxzCk8BRffsDy+B8iAbfyj YLwUSl2lCmat12M6ZHLdBREMFHpch1t33lvaOyLzH9no/iQCkM30yPLcN6YC/hJI82TM KFiXDx4daXw81RFX92NM2YTVGjEQFqX1Mw9G9o/6vd3vIDemOsPme+kinFp7Cf97uIFQ b6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=fmlcfpwvQZt/h1AszpZppC7oD9iO0g2rLKUxf53gOoA=; b=TO3LnUEZ9QU2/04FgrJfzPMYG9Zg//8pkgKnBCgdeqnLaJLhsFTe65nCChU1F1s7vh lqJKcQP33Im1zLStU20I8d3xE/Bgy2/xhIbA2lCrxuNtWUVQzWwLOvN37wCd1dR/r07m MZt7ED5eFWozRNEWwW2QGTfah/I3gy2ICvTcqjpZtFOHLNEmOFtDfhSQ4zHIdIMXylwK hl3Sug8hj2QYLpKU/S929owX8+opcUwNG60gTodseJpMu92eyD+6EzguZ0dQ+1aOiDuA HBa5YRGeReOgspQyJ8veT/0bMtdMz3LyixY7V/x+/HoSrs9H9fRCPn0tGL4+kpe9Fhd7 EnYg== X-Gm-Message-State: AOAM533mcmhn1aYtrRS7HHaufIvaWUOT2cIGUp5wrEPA05YQphGQ5PHS YYkkenRjAfiM1SUg2HUyrXIxC+Kko1U= X-Google-Smtp-Source: ABdhPJwP4pvSU3pkp8ODHNw31Z3zzsI/u/U0SIw4XgY9isItuzQmKM/BuB8bCTlwgEcDb4/3n0RBbQ== X-Received: by 2002:adf:97cb:: with SMTP id t11mr27954881wrb.292.1602444759130; Sun, 11 Oct 2020 12:32:39 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id a17sm21215068wra.29.2020.10.11.12.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:32:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 01/10] hw/isa: Introduce IsaIrqNumber enum Date: Sun, 11 Oct 2020 21:32:20 +0200 Message-Id: <20201011193229.3210774-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We are going to list all default ISA IRQs. As all the definitions are related, introduce the IsaIrqNumber type to enumerate them. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index ddaae89a853..2a052ffa025 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -8,7 +8,9 @@ #include "hw/qdev-core.h" #include "qom/object.h" -#define ISA_NUM_IRQS 16 +enum IsaIrqNumber { + ISA_NUM_IRQS = 16 +}; #define TYPE_ISA_DEVICE "isa-device" OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) From patchwork Sun Oct 11 19:32:21 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: 271558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76540C433E7 for ; Sun, 11 Oct 2020 19:34:23 +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 1AD8E2083B for ; Sun, 11 Oct 2020 19:34:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qyhEDrzJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AD8E2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRh6s-0004Po-2m for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5M-0002Ks-Cq; Sun, 11 Oct 2020 15:32:48 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:38732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5K-0006rA-Re; Sun, 11 Oct 2020 15:32:48 -0400 Received: by mail-wr1-x444.google.com with SMTP id n18so16576106wrs.5; Sun, 11 Oct 2020 12:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KNrZ+qtKi0zNMWfipUbnBZPxCaUXk1d2Q2TEnE3E2xk=; b=qyhEDrzJeDz52xoatSi74sFpVvUSxTWSOg9vhzvqcWGcIYm++zmA0hTZIWyOrg3tKX BUhSMsCPhUf5mYYl+jYALWSWBU/iWa+d12aUl1Q0R+mkdIs2IZKv9xbAO7zdWX6UCmKJ G9MBdkQuccs3QUov9AQa9KQWMhbh8hLZ3QOPeTny4n5o50W1suF8b93sNcWadmHcIvF9 R3xNufZsnx+n+nd4c+iRhj8c56xU7CL7VwwXgcQh8cQYTyShr/vpq8kiUZglqKQk5CUI J02wJh357SsHTZPuV2XogXyQabSmXTLbbkgvYCoriswBxjePnSQYJLkxA5IbSFVUEQ54 Gq4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KNrZ+qtKi0zNMWfipUbnBZPxCaUXk1d2Q2TEnE3E2xk=; b=ty9d3ySWVQj2fIwIA+TDLWrKaeIykdkdkXNQd5W6yC7mKCXr7DIoG2WX3l1nW2AEh6 qrZv2IMYPm1/MygD8DIGoIQGpe/6Bu+1N6IHZsLk14pi46VvGxezHuZGF5+p7YHJpKaF 7WT8mBQX7X8LC8g4ejixd1HznDNkfnQjmG57YKFHU/zG+bM+mBYOQR+c/QQRGuBIxOXM 1tcAaCwhFM4YImjT/tCOSJtn6FyGRTamZqSozVzWiTjKccUnfjy97ihCGoV8riv4eRB3 aTiMgGEjBfVjW7pRlZYxiIxkS7J28H/45Pq35F1bCNkxHMQnMCZ+hN8TbIX9inwGrAT3 dDZQ== X-Gm-Message-State: AOAM5332p5H8edBYJwTArCWSloSnMEDIwEQHumj3LCX/99jgiN8wrSWx kXehBdq/uJeu8ciZoQH+Gyh44muzSqI= X-Google-Smtp-Source: ABdhPJyWUKibpQ3WuPa7rpong1wHY4Bi5G98qh48QJpelYdlg+Inl4jBHACkMDF6xUAJ/M05PA+UTw== X-Received: by 2002:adf:d4c5:: with SMTP id w5mr1270365wrk.226.1602444764214; Sun, 11 Oct 2020 12:32:44 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id 64sm1625675wmd.3.2020.10.11.12.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:32:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 02/10] hw/isa: Add the ISA_IRQ_KBD_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:21 +0200 Message-Id: <20201011193229.3210774-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The PS2 keyboard uses IRQ #1 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/sparc64/sun4u.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 2a052ffa025..e139b88c992 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -9,6 +9,7 @@ #include "qom/object.h" enum IsaIrqNumber { + ISA_IRQ_KBD_DEFAULT = 1, ISA_NUM_IRQS = 16 }; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index ad5ca2472a4..d4c39490cd9 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -615,7 +615,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 6, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ)); - qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 1, + qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_KBD_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 12, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ)); From patchwork Sun Oct 11 19:32:22 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: 303149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC3E0C433DF for ; Sun, 11 Oct 2020 19:40:34 +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 424B52083B for ; Sun, 11 Oct 2020 19:40:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uz+5gg1w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 424B52083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRhCr-0003cc-6P for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:40:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5R-0002WT-Hn; Sun, 11 Oct 2020 15:32:53 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:46776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5Q-0006rS-1y; Sun, 11 Oct 2020 15:32:53 -0400 Received: by mail-wr1-x441.google.com with SMTP id n6so16270999wrm.13; Sun, 11 Oct 2020 12:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0jpaxMymalQzJe7nkt3fK37nWgDJARQE9RMKxlzHDKI=; b=uz+5gg1wHDtPr/S5ORv4Td1PAh5DSIAfCQWuFHeFFoQsmiwviFwUO9X+mxPY4AcYvY dhEklevtq1PXGH+HkTxJ3yLLf65URD5rG/8a9FTAiShuYX4A5SYs+Zpqy8/3fNWflOhW fFtuldLo4fTV2TxhVgyaoxqkIYIocYWAKRKzwdax30CpjGi1oRo3ojqEFiby0OlDJjZr KtFy4Kq9WsGkvJUD6QfCL643E3hjiQvlQJ/121uiF/CEdiDItNOXUMYwBoE4wAv803Zo txC9m71bcSEWbXa3lSSaSve+AU8z6U8MKvjtXyToez1LfPTD3pMY9McEdi+ujrY0blKX yO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0jpaxMymalQzJe7nkt3fK37nWgDJARQE9RMKxlzHDKI=; b=lwZkdqlCkKQvUYkBOFoNkhyrMy3CxiLF1oVrjkYKiY+hGY1f5ecfmGHpLvCKlavv3a RIB66SyhtLZRNuFl1C3p5YrEUOTxdl7qyYqI9Git4//tL3fVyhd78Kn7P75ZMFO+t10B +6u/E/O5ul8jxtNuFgkFeYoGIRq7YLTbRjYF6RzmoDPzkWCuRgLQxINm3VmA8VlXJlq2 f6v4wMKCo7VJc71IYuif3YPXAz6ekZgJN+n0fJJyVVRQ8ixPCdeq8h34IKC5KLJW0nl/ gyITn2IntvPylUSvSP1JOYGSV9W+zdej2ShVG3L1berSLV31zuLjg7ZP9D3EKTR7+CG2 XkFA== X-Gm-Message-State: AOAM533QC5mXLAp03cN8Po7owt82QAuQVfYE4RtOcKU1mruoHdSXz2Ca jB2fDkky7px+Y/hXnbZDqnG85kqhm/k= X-Google-Smtp-Source: ABdhPJzhnI81QO4NuG8+dCiW+MMDXBui58TatPQ8g+Lc44KzsdSlLSS4QaC7ExFGWP3IQSy0YyDHJQ== X-Received: by 2002:adf:bacc:: with SMTP id w12mr16965624wrg.66.1602444769499; Sun, 11 Oct 2020 12:32:49 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id a81sm23030618wmf.32.2020.10.11.12.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:32:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:22 +0200 Message-Id: <20201011193229.3210774-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The first serial port uses IRQ #4 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/sparc64/sun4u.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index e139b88c992..519296d5823 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -10,6 +10,7 @@ enum IsaIrqNumber { ISA_IRQ_KBD_DEFAULT = 1, + ISA_IRQ_SER_DEFAULT = 4, ISA_NUM_IRQS = 16 }; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d4c39490cd9..6e42467d5cc 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -619,7 +619,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 12, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ)); - qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4, + qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_SER_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); switch (vga_interface_type) { From patchwork Sun Oct 11 19:32:23 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: 303152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C60AAC433E7 for ; Sun, 11 Oct 2020 19:34:35 +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 6AEBF2145D for ; Sun, 11 Oct 2020 19:34:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g7OQZQXc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AEBF2145D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRh74-0004xN-JQ for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:34:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5X-0002dR-4w; Sun, 11 Oct 2020 15:32:59 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:44566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5V-0006rw-LN; Sun, 11 Oct 2020 15:32:58 -0400 Received: by mail-wr1-x444.google.com with SMTP id t9so16557288wrq.11; Sun, 11 Oct 2020 12:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=owliHLOWbWXpZmpPZaYeHDfZXoImwW9/yfAFwtcxj6M=; b=g7OQZQXcv3KXHokyULyGv+Ywkf4wWXZ5c7oE+RwQzJcG0si14dbQfekusSJzoJ9MgO 5XG1W9SlmtpG6HEQ1jCYywVYL56I+FZfIsGyjfwCliqv2NABM0sHdW4IAlPQlLM6r8tW sZcbmbj/Q7dqKpHmk5BE+K74LQTsNYlD8fw4vTGhcSeCb3CGaCebhkpwVrY5cL2oOhrH LMwOiWy4+DkMbJ+kABjF34uAOHxMoCAE0IFnEpvFFSBYRsj40oWg1bxYwcSO+ScI77uv njgAZgZx0+u9xZ3YtutxvbVzPcaBBuWtr0XXy+ZtePPG3QVPFU5IKXylmBHrfRIrEjRQ 698w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=owliHLOWbWXpZmpPZaYeHDfZXoImwW9/yfAFwtcxj6M=; b=myXgMfLp80yANrDXVR4hbtTb6NbBzolGpBeaXJpEOxDnulyilXBVWNEvNLDWGKNk6G 3YQJq6c5f1Ocb8XDTgs5uBrCCStXBJHaMvYw/IQyMhV7GBSporWLY7xgEi5waevvG5DX 2r087cnz0iHKxeJnT/S/MgyiCJia9IEmC8n/+hQ+pJa+POgUEAOpdq5z4phdvMe8elEU kYeo6BGbpbOVQFKjnKxP8gMAy7QGwnSHLyAc9mIGm315r5NJQlKCoaHgcQY92UQWmGQg M72b8kyBb4rdT3w9po/2+we8rTb9LW+6jdNWvHquZBFecdYxjqD9iTvdubDgYfk8TSpJ kN7g== X-Gm-Message-State: AOAM532t137p/7vlUjZgruY+5S7bVTd9H5bASd+h/xc+BNap3Y48H6GK N6tGFNXunzoZbIE2FatJB5q7z0fgz+o= X-Google-Smtp-Source: ABdhPJxy68Wf0o+etONuXcLIVKe+JDROsKLnvKm0eP9LYZzuySddD8NjhEjBnsX/mx3QpFlm9+JN1Q== X-Received: by 2002:adf:fa06:: with SMTP id m6mr20571534wrr.253.1602444774960; Sun, 11 Oct 2020 12:32:54 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id w1sm22162629wrp.95.2020.10.11.12.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:32:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:23 +0200 Message-Id: <20201011193229.3210774-5-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/i386/acpi-build.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/ipmi/isa_ipmi_kcs.c | 2 +- hw/tpm/tpm_tis_isa.c | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 519296d5823..e4f2aed004f 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -11,6 +11,7 @@ enum IsaIrqNumber { ISA_IRQ_KBD_DEFAULT = 1, ISA_IRQ_SER_DEFAULT = 4, + ISA_IRQ_TPM_DEFAULT = 5, ISA_NUM_IRQS = 16 }; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 45ad2f95334..2b6038ab015 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1886,7 +1886,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, Rewrite to take IRQ from TPM device model and fix default IRQ value there to use some unused IRQ */ - /* aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); */ + /* aml_append(crs, aml_irq_no_flags(ISA_IRQ_TPM_DEFAULT)); */ aml_append(dev, aml_name_decl("_CRS", crs)); tpm_build_ppi_acpi(tpm, dev); diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index b7c2ad557b2..13a92bd2c44 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -137,7 +137,7 @@ static void *isa_ipmi_bt_get_backend_data(IPMIInterface *ii) static Property ipmi_isa_properties[] = { DEFINE_PROP_UINT32("ioport", ISAIPMIBTDevice, bt.io_base, 0xe4), - DEFINE_PROP_INT32("irq", ISAIPMIBTDevice, isairq, 5), + DEFINE_PROP_INT32("irq", ISAIPMIBTDevice, isairq, ISA_IRQ_TPM_DEFAULT), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index 7dd6bf0040a..c956b539688 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -144,7 +144,7 @@ static void *isa_ipmi_kcs_get_backend_data(IPMIInterface *ii) static Property ipmi_isa_properties[] = { DEFINE_PROP_UINT32("ioport", ISAIPMIKCSDevice, kcs.io_base, 0xca2), - DEFINE_PROP_INT32("irq", ISAIPMIKCSDevice, isairq, 5), + DEFINE_PROP_INT32("irq", ISAIPMIKCSDevice, isairq, ISA_IRQ_TPM_DEFAULT), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index 6fd876eebf1..5a4afda42df 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -91,7 +91,7 @@ static void tpm_tis_isa_reset(DeviceState *dev) } static Property tpm_tis_isa_properties[] = { - DEFINE_PROP_UINT32("irq", TPMStateISA, state.irq_num, TPM_TIS_IRQ), + DEFINE_PROP_UINT32("irq", TPMStateISA, state.irq_num, ISA_IRQ_TPM_DEFAULT), DEFINE_PROP_TPMBE("tpmdev", TPMStateISA, state.be_driver), DEFINE_PROP_BOOL("ppi", TPMStateISA, state.ppi_enabled, true), DEFINE_PROP_END_OF_LIST(), From patchwork Sun Oct 11 19:32:24 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: 271556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67AE0C433E7 for ; Sun, 11 Oct 2020 19:37:00 +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 DB1932083B for ; Sun, 11 Oct 2020 19:36:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DWmvBL6I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB1932083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRh9O-000055-WD for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:36:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5c-0002hX-FR; Sun, 11 Oct 2020 15:33:04 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5a-0006sD-UN; Sun, 11 Oct 2020 15:33:04 -0400 Received: by mail-wm1-x341.google.com with SMTP id j136so15335478wmj.2; Sun, 11 Oct 2020 12:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WNozgBziJzkT1dGIty7aG0vAuuPyLVJMvqy8EJgjQmQ=; b=DWmvBL6IRfp99BX6ScEK2l7vWxbpQihjtrvIHXvb7k3RF3C5Ld1HPgFjhmstZkGXhU Gg9/IGJVL6vwxFl5E31OeToshS0ktziFNXtKXJ9+YLvSEKHnAnB4xlq4AYNHdiGnweYz +NicU+1RVd4SfQJNrCCLwBWX9oZ1WP75uQs04t0G8PF3gEvN1v2gRMbSQIS+Q0Vv6Wx9 jaNewj+2pmQgC9Fa2ICcnwdC8Ov4izfSfFr4L+zEzi/ozMcgCcB6YWmXqYmvLXNZ1bZl f/NyMPUgFcH+1Kgqf792g2uRmj5F7lr89zdVSs+/sHXnoAKd2rBIcoCTcQqTmADg+A9H ssEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WNozgBziJzkT1dGIty7aG0vAuuPyLVJMvqy8EJgjQmQ=; b=mMG0Y0lK9Mgo1/NrnS477iIuT63VIGycPjTZPaJIFGvcx03ct0bnmO7cdOa4M+yA2Y s8Huph9F5li8q3KRZia2rbpwU4Yi7jUqSeJrV7A3XA7N36KJtrODzByUD06H5wFAZ0uD lIhWmqA0NRpy01+xyzRpjazetJPTr8UyIOe0uknIvkzI+AI0n1Cm2E95Tg+EVjtdxdMI 5wyzgr5VEim6Mv/aT4SJDHdlzRghHIewu3Ak9nAvofdoZ009W9hxkaT67QRGyEmqODi7 elktNoWtUkey7BJmhY5hh1244Zkl08ra+yIcr2xgHHmL04U1AICzU6QJo1UKIX7YmBpK 8XuA== X-Gm-Message-State: AOAM5328RgDU7b0zsx9yzuMzcWyrqV2wKJV5KDfDPwXWeSwlJZGRLDX+ cMOL4WtNZ6EwIIFCbdWFcXJ+VSj0pEQ= X-Google-Smtp-Source: ABdhPJz6AmeuRpZSCDikDKC2ojYg88N8DYb0MNlaB6nGe34OruJt1e0b/fQxXy+WKu6hXrNPAKi73A== X-Received: by 2002:a1c:a5c4:: with SMTP id o187mr7716393wme.171.1602444780053; Sun, 11 Oct 2020 12:33:00 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id k18sm3380247wrx.96.2020.10.11.12.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:32:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:24 +0200 Message-Id: <20201011193229.3210774-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The floppy disk controller uses IRQ #6 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé Acked-by: John Snow --- include/hw/isa/isa.h | 1 + hw/block/fdc.c | 4 ++-- hw/sparc64/sun4u.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index e4f2aed004f..214a6730598 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -12,6 +12,7 @@ enum IsaIrqNumber { ISA_IRQ_KBD_DEFAULT = 1, ISA_IRQ_SER_DEFAULT = 4, ISA_IRQ_TPM_DEFAULT = 5, + ISA_IRQ_FDC_DEFAULT = 6, ISA_NUM_IRQS = 16 }; diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 4c2c35e223a..531fc4c0b72 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2855,7 +2855,7 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); - aml_append(crs, aml_irq_no_flags(6)); + aml_append(crs, aml_irq_no_flags(ISA_IRQ_FDC_DEFAULT)); aml_append(crs, aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); @@ -2889,7 +2889,7 @@ static const VMStateDescription vmstate_isa_fdc ={ static Property isa_fdc_properties[] = { DEFINE_PROP_UINT32("iobase", FDCtrlISABus, iobase, 0x3f0), - DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, 6), + DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, ISA_IRQ_FDC_DEFAULT), DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2), DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk), DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk), diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 6e42467d5cc..458dc215e6f 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -613,7 +613,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, /* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */ qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ)); - qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 6, + qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_FDC_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_KBD_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ)); From patchwork Sun Oct 11 19:32:25 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: 271555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 582A0C433DF for ; Sun, 11 Oct 2020 19:37:41 +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 0313D2145D for ; Sun, 11 Oct 2020 19:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mC1slaEe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0313D2145D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRhA4-0000vb-12 for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5g-0002l5-Rj; Sun, 11 Oct 2020 15:33:10 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5f-0006sl-B5; Sun, 11 Oct 2020 15:33:08 -0400 Received: by mail-wm1-x341.google.com with SMTP id f21so15212466wml.3; Sun, 11 Oct 2020 12:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T47fdn4RxOEr/33O8p4c1fGY3UD39OWzHlO0HGQUKaU=; b=mC1slaEerXeh3/utyzoo5ACyMyf3Uyzu0ByT32VzXV0ZAGOzsxTHm59fCAreGa37sB s9sy5HEqF+6m5iiyTUz1BchC6JRy7vrxUJ/VV+CB6hjMekOdQd1Vua2HlbTO9lzdhLjy BzNKy6oZ67uRWx+nHvKq0YeJP+lMte3UNFHQE/pW9rbUH90pblr83VgFvVkgQbnycvlG x8KQVx/pwjPO75dQ0MjwTQjqeDWrSMMmRDMPZL1MhFXGYpyzxBvTG3xQvk0ifLluGF8R 5tmJ+eqt0zVF83s3mukbRsCKIFN4pA//5wi7REfSH7FiWyAI+5Bzw7H6Xyih1AM7Mzhz bU4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=T47fdn4RxOEr/33O8p4c1fGY3UD39OWzHlO0HGQUKaU=; b=LxGct3xMQLpiBWnQdCZRXoMxMCcaAlJh8139VLLGB8XlB0y4Pi0k0174J3/yF0NsSP dA2bIi5PbzDqBg/uqtJwh4L4FzwifTRO7YoMFNJYgkx2oGyGGARlnQhMFn869QkylDO0 o+8QIqSr5K7kr8qlEMpYH2FpiXUA3oZ0WE/fI85yarMs7CkuX7ZiXUBck33rR/3kXex4 HeoEslCTiS9zzVBbIlk0ypYuEcFEHcdADV473Q3JfhCmMzBBXGJtS4V4TL9i8Un9l9ye IZgR5bwubQ6Dj/vqPVxzGSRk2LmqmnjhO2X7R3UnYMBBQncSEzTSdrK310vElKMw3bXP Nd3A== X-Gm-Message-State: AOAM531jW06n5yRZp1NcBRXnUWVS0jAbnUpVq9vfUylsU8eWzmDIneBQ ZHU8C2Y2nJxINykStz1MXnM8G7F9tzo= X-Google-Smtp-Source: ABdhPJz2DOe4Z1/29V0nxb/owBp2f0xdwN7f8+GhaG+tphVo+1QSQfP243Li5kkzVC/ofYRDjbJtlg== X-Received: by 2002:a05:600c:210f:: with SMTP id u15mr8170317wml.53.1602444785001; Sun, 11 Oct 2020 12:33:05 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id n2sm21770729wrt.82.2020.10.11.12.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:33:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:25 +0200 Message-Id: <20201011193229.3210774-7-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The parallel port uses IRQ #7 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/char/parallel.c | 2 +- hw/sparc64/sun4u.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 214a6730598..081fa446152 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -13,6 +13,7 @@ enum IsaIrqNumber { ISA_IRQ_SER_DEFAULT = 4, ISA_IRQ_TPM_DEFAULT = 5, ISA_IRQ_FDC_DEFAULT = 6, + ISA_IRQ_PAR_DEFAULT = 7, ISA_NUM_IRQS = 16 }; diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 8b418abf719..9e0d80ec0d0 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -636,7 +636,7 @@ bool parallel_mm_init(MemoryRegion *address_space, static Property parallel_isa_properties[] = { DEFINE_PROP_UINT32("index", ISAParallelState, index, -1), DEFINE_PROP_UINT32("iobase", ISAParallelState, iobase, -1), - DEFINE_PROP_UINT32("irq", ISAParallelState, isairq, 7), + DEFINE_PROP_UINT32("irq", ISAParallelState, isairq, ISA_IRQ_PAR_DEFAULT), DEFINE_PROP_CHR("chardev", ISAParallelState, state.chr), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 458dc215e6f..c5b3e838ac2 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -611,7 +611,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, pci_realize_and_unref(ebus, pci_busA, &error_fatal); /* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */ - qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7, + qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_PAR_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_FDC_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ)); From patchwork Sun Oct 11 19:32:26 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: 271557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DC38C43457 for ; Sun, 11 Oct 2020 19:34:36 +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 47BEB2083B for ; Sun, 11 Oct 2020 19:34:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ftn7bHiD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47BEB2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRh75-00050X-8I for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:34:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5m-0002ni-7b; Sun, 11 Oct 2020 15:33:14 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5k-0006tV-JP; Sun, 11 Oct 2020 15:33:13 -0400 Received: by mail-wr1-x443.google.com with SMTP id g12so16550915wrp.10; Sun, 11 Oct 2020 12:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0QbPMBGbr2e8OygEfUqckUt1pMEO3ugEPGl8j5TDG5o=; b=Ftn7bHiDyZHW5cvXmnoVfxhIZ7x0GAUDWdhKYIp/hJsQQdkQjk3xFHKr2bE32ZUsTx OxkxZ8/FBeopmFzh9avflV6h87EtXxfM4cijGzielzjl88XTJCzZzfaxZUkTItX9gAHb CLrnZtGlC6tE+lxRTmg1270LdbOjcIkeG5WHj6jHawfqgjSKLufBdjis4mMwK66y/OSO TcqFClXiuxiiqAEcECDveoNEz6bLHh5C9rAB0CATtw6us/zyCMReFCPIb5H7mojw2CAj 5IfyLDg26JDoJzaddYnqsUGTkg0GeR2ISv2WtIPtkEiGu9LaBMq5Aqy5cwLgdtLe3V82 xdHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0QbPMBGbr2e8OygEfUqckUt1pMEO3ugEPGl8j5TDG5o=; b=hDTteyPJSYbvnX6eX2PfJgnllS+sSpxIDRbnf9UK9YOa00ysE5/vVeDMdx1qhOpe3q jk667LVOLlzgtuTCP7ZDvXeSI0Hb/17pH7yyaEaRvBiQhGOzD19ensWo8uMXVW7ZMR+n CQIS7BzcGa3n2AESDfeyML47jd48k7Zv4KKZgwx97zcGFJC/RtAyvB4ALpReNeqTOjy2 czBew6+pMfLEOWyS+VEfoj5QBd58TLHbEN59HdBnO4dJXPBlynjIxL9THCIpMAVoZnZS w0KjFEg84l0leXO57kVSYeGE5sTwYzdX/kRaG9l+qtVv6K8TXWdBmOoDUmKwo8m+7hSi RZVQ== X-Gm-Message-State: AOAM533nr23KFmMJ/yEUIUb2oBvGP/OtFMaNUXxtTFHQpSToCQtXDLC+ KK9eUi1yrxEJ94qRReNqBlI9KoC4Ff0= X-Google-Smtp-Source: ABdhPJx2nHHdw1cijWbRr03kOBOnQuibBEjmOLn5hkpeJFmTJLtLlItz1XL8TxPfbcWpGyc3J4e5dQ== X-Received: by 2002:adf:c5c3:: with SMTP id v3mr26840799wrg.205.1602444790002; Sun, 11 Oct 2020 12:33:10 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id z11sm21498835wrh.70.2020.10.11.12.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:33:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 07/10] hw/isa: Add the ISA_IRQ_RTC_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:26 +0200 Message-Id: <20201011193229.3210774-8-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The RTC time keep clock ses IRQ #8 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + include/hw/rtc/mc146818rtc.h | 1 - hw/isa/piix4.c | 2 +- hw/rtc/m48t59-isa.c | 2 +- hw/rtc/mc146818rtc.c | 4 ++-- hw/timer/hpet.c | 8 ++++---- tests/qtest/rtc-test.c | 8 ++++---- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 081fa446152..9f78ff11246 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -14,6 +14,7 @@ enum IsaIrqNumber { ISA_IRQ_TPM_DEFAULT = 5, ISA_IRQ_FDC_DEFAULT = 6, ISA_IRQ_PAR_DEFAULT = 7, + ISA_IRQ_RTC_DEFAULT = 8, ISA_NUM_IRQS = 16 }; diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index 5b45b229244..1cca26399ce 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -47,7 +47,6 @@ struct RTCState { QLIST_ENTRY(RTCState) link; }; -#define RTC_ISA_IRQ 8 #define RTC_ISA_BASE 0x70 ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index a50d97834c7..d9cceff9c84 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -185,7 +185,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) if (!qdev_realize(DEVICE(&s->rtc), BUS(isa_bus), errp)) { return; } - isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, RTC_ISA_IRQ); + isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, ISA_IRQ_RTC_DEFAULT); piix4_dev = dev; } diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index cae315e4885..bdde427a945 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -124,7 +124,7 @@ static void m48t59_isa_realize(DeviceState *dev, Error **errp) s->model = u->info.model; s->size = u->info.size; - isa_init_irq(isadev, &s->IRQ, 8); + isa_init_irq(isadev, &s->IRQ, ISA_IRQ_RTC_DEFAULT); m48t59_realize_common(s, errp); memory_region_init_io(&d->io, OBJECT(dev), &m48t59_io_ops, s, "m48t59", 4); if (d->io_base != 0) { diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 7a38540cb9d..ba156b9a0bd 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -981,7 +981,7 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq) if (intercept_irq) { qdev_connect_gpio_out(dev, 0, intercept_irq); } else { - isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ); + isa_connect_gpio_out(isadev, 0, ISA_IRQ_RTC_DEFAULT); } object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isadev), @@ -1020,7 +1020,7 @@ static void rtc_build_aml(ISADevice *isadev, Aml *scope) crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, RTC_ISA_BASE, RTC_ISA_BASE, 0x01, 0x08)); - aml_append(crs, aml_irq_no_flags(RTC_ISA_IRQ)); + aml_append(crs, aml_irq_no_flags(ISA_IRQ_RTC_DEFAULT)); dev = aml_device("RTC"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00"))); diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 05fd86af817..579a9faecf3 100644 --- a/hw/timer/hpet.c +++ b/hw/timer/hpet.c @@ -196,7 +196,7 @@ static void update_irq(struct HPETTimer *timer, int set) * timer0 be routed to IRQ0 in NON-APIC or IRQ2 in the I/O APIC, * timer1 be routed to IRQ8 in NON-APIC or IRQ8 in the I/O APIC. */ - route = (timer->tn == 0) ? 0 : RTC_ISA_IRQ; + route = (timer->tn == 0) ? 0 : ISA_IRQ_RTC_DEFAULT; } else { route = timer_int_route(timer); } @@ -615,11 +615,11 @@ static void hpet_ram_write(void *opaque, hwaddr addr, if (activating_bit(old_val, new_val, HPET_CFG_LEGACY)) { qemu_set_irq(s->pit_enabled, 0); qemu_irq_lower(s->irqs[0]); - qemu_irq_lower(s->irqs[RTC_ISA_IRQ]); + qemu_irq_lower(s->irqs[ISA_IRQ_RTC_DEFAULT]); } else if (deactivating_bit(old_val, new_val, HPET_CFG_LEGACY)) { qemu_irq_lower(s->irqs[0]); qemu_set_irq(s->pit_enabled, 1); - qemu_set_irq(s->irqs[RTC_ISA_IRQ], s->rtc_irq_level); + qemu_set_irq(s->irqs[ISA_IRQ_RTC_DEFAULT], s->rtc_irq_level); } break; case HPET_CFG + 4: @@ -711,7 +711,7 @@ static void hpet_handle_legacy_irq(void *opaque, int n, int level) } else { s->rtc_irq_level = level; if (!hpet_in_legacy_mode(s)) { - qemu_set_irq(s->irqs[RTC_ISA_IRQ], level); + qemu_set_irq(s->irqs[ISA_IRQ_RTC_DEFAULT], level); } } } diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c index c7af34f6b1b..9ae90d4925c 100644 --- a/tests/qtest/rtc-test.c +++ b/tests/qtest/rtc-test.c @@ -278,7 +278,7 @@ static void alarm_time(void) /* set DEC mode */ cmos_write(RTC_REG_B, REG_B_24H | REG_B_DM); - g_assert(!get_irq(RTC_ISA_IRQ)); + g_assert(!get_irq(ISA_IRQ_RTC_DEFAULT)); cmos_read(RTC_REG_C); now.tm_sec = (now.tm_sec + 2) % 60; @@ -288,14 +288,14 @@ static void alarm_time(void) cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) | REG_B_AIE); for (i = 0; i < 2 + wiggle; i++) { - if (get_irq(RTC_ISA_IRQ)) { + if (get_irq(ISA_IRQ_RTC_DEFAULT)) { break; } clock_step(1000000000); } - g_assert(get_irq(RTC_ISA_IRQ)); + g_assert(get_irq(ISA_IRQ_RTC_DEFAULT)); g_assert((cmos_read(RTC_REG_C) & REG_C_AF) != 0); g_assert(cmos_read(RTC_REG_C) == 0); } @@ -645,7 +645,7 @@ static void uip_stuck(void) static uint64_t wait_periodic_interrupt(uint64_t real_time) { - while (!get_irq(RTC_ISA_IRQ)) { + while (!get_irq(ISA_IRQ_RTC_DEFAULT)) { real_time = clock_step_next(); } From patchwork Sun Oct 11 19:32:27 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: 303148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA8BAC433DF for ; Sun, 11 Oct 2020 19:42:46 +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 347F820790 for ; Sun, 11 Oct 2020 19:42:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qEwwLhXf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 347F820790 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRhEz-0006pv-BH for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:42:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5r-0002zd-1q; Sun, 11 Oct 2020 15:33:19 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5p-0006vE-Ii; Sun, 11 Oct 2020 15:33:18 -0400 Received: by mail-wm1-x341.google.com with SMTP id j136so15336054wmj.2; Sun, 11 Oct 2020 12:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ottyxadkfdG6t1j9EHj71mxgUhLG6Ki7NMaGNynZJD0=; b=qEwwLhXfmlgPiK25yyOcjxsJ3q6RS8jvY3+SEaEz2+i7iO1P0LlvcWHDK4l3Ri4LPB qGpOdydfbM0UerCDmcJ94eviy2yU5Sb2QSx5PCS3a9QmWlP6G4lmErLaesEeYq33Eqk8 Oq78gsC/3iuwPT39zyXdDhPj8J+50eBMUnUYHnZxrdpgtDRdcFOqnLT2l88GYI1PwJy+ SAP4Eqycljc26DjboqgJ+oXEl852pxyECm7Fyg1eLe7CaIhjeqiMnkVMGG1AYRdlgKoF F75IVc/9m9kzcxiIa8Ts3FWnLnRpJQXeCvUZQBxZFW7R5dbuW5PBhnAz/sjMa4x7qfmq 8Ugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ottyxadkfdG6t1j9EHj71mxgUhLG6Ki7NMaGNynZJD0=; b=SrYQeNm6OyekXfDBGNV2Pkyv/cwzBj5qBeJuOScA1MH4w8Fj3LQzU6NOTTO9H0/b42 bV7Z5lxTUg2oBAFATSXqEghdArJkkFFBz5f5VmqUhrsNtTgnid+Y/OzS8N5661CDNZtc It/YIzebLpXtto5Fz97RU5e3miGriH6F9UZFDYKl/YuTf6HSt8LmH11GxSTx57tRhj5Y rnL+YR/VEpoEov94ZkF7ga+ykZU8C7NUo45rJ0if+84+Ha/4Ft8mBIq6/JIBNO+SKk2A bZpzO3L6hgkT1wiANXTtHkjNnTVRQb8N1QnBuUi1ofRdkEHqD7e+p40d2OQSRRQxPpHo Kwsg== X-Gm-Message-State: AOAM532V76eorRPsVoc1VmdUPOJBzZw+eoY9KYZJNy9reUoW5rwrEk04 T9vZk9XmDvYh1wqwy5HCs8MfTJgXEHM= X-Google-Smtp-Source: ABdhPJxwCHk9ZmaUKr7CkbYZxWaEQIWMZ6rAQBHwbNpxGejuErNgC8kytvS3q5p8QQv7R4bsOtQhNQ== X-Received: by 2002:a1c:3b8a:: with SMTP id i132mr7793744wma.178.1602444795066; Sun, 11 Oct 2020 12:33:15 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id 88sm22673596wrl.76.2020.10.11.12.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:33:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:27 +0200 Message-Id: <20201011193229.3210774-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The network devices use IRQ #9 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/net/ne2000-isa.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 9f78ff11246..11166592246 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -15,6 +15,7 @@ enum IsaIrqNumber { ISA_IRQ_FDC_DEFAULT = 6, ISA_IRQ_PAR_DEFAULT = 7, ISA_IRQ_RTC_DEFAULT = 8, + ISA_IRQ_NET_DEFAULT = 9, ISA_NUM_IRQS = 16 }; diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index dd6f6e34d3c..e31e86c14af 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -80,7 +80,7 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error **errp) static Property ne2000_isa_properties[] = { DEFINE_PROP_UINT32("iobase", ISANE2000State, iobase, 0x300), - DEFINE_PROP_UINT32("irq", ISANE2000State, isairq, 9), + DEFINE_PROP_UINT32("irq", ISANE2000State, isairq, ISA_IRQ_NET_DEFAULT), DEFINE_NIC_PROPERTIES(ISANE2000State, ne2000.c), DEFINE_PROP_END_OF_LIST(), }; From patchwork Sun Oct 11 19:32:28 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: 303150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 421FDC433E7 for ; Sun, 11 Oct 2020 19:37:41 +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 CE37D2083B for ; Sun, 11 Oct 2020 19:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="glKKe2Me" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE37D2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRhA3-0000wx-UK for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:37:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh5w-0003CF-4K; Sun, 11 Oct 2020 15:33:24 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5u-0006w8-Jd; Sun, 11 Oct 2020 15:33:23 -0400 Received: by mail-wr1-x441.google.com with SMTP id t9so16558142wrq.11; Sun, 11 Oct 2020 12:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=76wJgIrqTSi0DDRrVUiOHwWarPfXaZKRh0PO2TH3Udg=; b=glKKe2MexCos8D4mlixBOKwOdTUN6RsBj1DiGhj3sc3TpL0PkRI2uq5EjQlyvJmlae GvVDZ+GpYX5iCitruMHihden4WKXVDfnzaesPSu/g45rxInn3hIQyLttEipiSCPO6beZ Rka9pIp9eni2aQCBduBCn9bnIkxH1U4CxO8GPLoVcMcj0Z3spMiLZkDVjJkhWuaLYzVR iIKGjsTW1Gn4/fYVTJ6/njhBtjGANDnhSa5LGV8or1Zs+gsEez9b8vKfA336eleFnG6F zO9PeT6SeIdQ477zmubsj1gBY4YmQvviCgU5qSg8N7GLmtZ5Mh27nxlPCtD6p712Psr9 klww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=76wJgIrqTSi0DDRrVUiOHwWarPfXaZKRh0PO2TH3Udg=; b=OrWZgDto75eVOU9weg/fP7+0q5xcdi9/No49gqWUSdPGnOAuLAsE41FFmDNgrWuBOr f5lq+INPlStclfevTXoc/CPyX2iOdzVkkZ39YcPwd5rW3Gg23+kw4ITFuu+MFb4KWHRz JmdEkFcIgCczX2RQCwwVwYhXa85fxzJCDd+rkX7DEEvqI7QNOidXl6tFkpjZcRL5LVkx IZzMAC9KZ85Kx5muDfAgQGCZ0uyayc5ITq1LJOCs/wrNDL7u92TKKNq5EBdgIuh774R1 5hk+DXk15ngylhHM6HrUL8hx30a4qUM8Co+on389Zy+qNHSH4VyNeYDs0SUBzP0TW5bF PmSA== X-Gm-Message-State: AOAM533zi39oB8KfW/Y/Vk8DXwn30s2rTSQW8ff8766LTd10hNB4yBOu VQp19HQHaYbPyCMc85z0szXrqlT5a8A= X-Google-Smtp-Source: ABdhPJzO9f2oN+VJQaGJdLE0ijcw7BO3YppTUBTPgvef2k2DlR+3vVWdWVgaMP9no0LDs/RazXUMQA== X-Received: by 2002:adf:f78d:: with SMTP id q13mr877669wrp.258.1602444800147; Sun, 11 Oct 2020 12:33:20 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id t5sm21663725wrb.21.2020.10.11.12.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:33:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:28 +0200 Message-Id: <20201011193229.3210774-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The PS2 mouse uses IRQ #12 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/input/pckbd.c | 2 +- hw/sparc64/sun4u.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 11166592246..43cdc3c47b6 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -16,6 +16,7 @@ enum IsaIrqNumber { ISA_IRQ_PAR_DEFAULT = 7, ISA_IRQ_RTC_DEFAULT = 8, ISA_IRQ_NET_DEFAULT = 9, + ISA_IRQ_MOU_DEFAULT = 12, ISA_NUM_IRQS = 16 }; diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index dde85ba6c68..140c992b03b 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -577,7 +577,7 @@ static void i8042_build_aml(ISADevice *isadev, Aml *scope) aml_append(kbd, aml_name_decl("_CRS", crs)); crs = aml_resource_template(); - aml_append(crs, aml_irq_no_flags(12)); + aml_append(crs, aml_irq_no_flags(ISA_IRQ_MOU_DEFAULT)); mou = aml_device("MOU"); aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index c5b3e838ac2..ddd51c7cbbe 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -617,7 +617,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_KBD_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ)); - qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 12, + qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_MOU_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ)); qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_SER_DEFAULT, qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ)); From patchwork Sun Oct 11 19:32:29 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: 271554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAFC3C433DF for ; Sun, 11 Oct 2020 19:41:04 +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 74E882083B for ; Sun, 11 Oct 2020 19:41:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hmnrpmtD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74E882083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRhDL-0004hc-KT for qemu-devel@archiver.kernel.org; Sun, 11 Oct 2020 15:41:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRh61-0003Pj-B4; Sun, 11 Oct 2020 15:33:29 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:36705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRh5z-0006wf-PH; Sun, 11 Oct 2020 15:33:29 -0400 Received: by mail-wm1-x344.google.com with SMTP id e2so15335472wme.1; Sun, 11 Oct 2020 12:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gejAdYQY/teMYz2RHH6Mc87RW7QIZIz1gQu9dTLuxMg=; b=hmnrpmtDQ1h8IpxAsATjEWAyJt6HnVV89VQFF+cY0RjjXVPeqTXZY5Dcl5X0//qDDW LzpQBwowdPn6+AWsK3f1NGZk2BSFOXibGnIfFb7HBKfjcjOkGq6g/0s8RLM0asrI0Oc8 eYO8mD+QSdXE2ODsKW7bviGCec1fBcNf2vr4SWN62Hzoc5/3fT/UprYLBV9odC74hGeV 7r9ZsIJMdl7y0+fgVTyfCrdAE6qLA9VGXOurdDeSxKj1zbQhEVd6sZuV+Zm3T/nzgp52 Ik1RYh79Qf69uCIMokB1jqFiPJvkleq3LshytFsuYSBf7tI8vBGOx+C25Lc1Dw35dLHJ MysA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gejAdYQY/teMYz2RHH6Mc87RW7QIZIz1gQu9dTLuxMg=; b=t2tOtZhtt8GpgsyPIHTQscPmL3vLeqotZznakyRLRCYZ5fK3fo7nVfx5FaazDFJkIG /SGCnpKC9VKxR4MjczJW41RMyNVB9wrK60OwKH0Bzx4fMFdtH9uiNja1hejmGYLNbqAR wFl/NFig/Eaacl4h5pTz8bZB0uMuyuX4iadQzvvWJ785afrSKJ+v87U+BMsFA1D0d8ne 3lZP/OyTP1QYp/VLX+t1ByTl+G80RPs3tGup8asDHUPYGQEGdqIKjQpT2jv8Ey5tx+gJ 3Z4oK5GpLImMo7PqfP4Dhs/mx2eU/uP8EIPNNLDHI6XKw+kGGDCdSALjMtvNIJ2C04r2 pfEw== X-Gm-Message-State: AOAM531LLcgpRdwcROvEtab8My5PtjL/x4Ha7TBOsZ6zIUkHg3dzBJNZ hXFPwebWA4L78CJnQ2XPQxpkwF8k2SA= X-Google-Smtp-Source: ABdhPJxBLeYlan/olq39IXZxlC37Oueo1eu0SAO7/jy1Ukn3zHUcPt1OS23XOGWG1GLsYM74q0ne2g== X-Received: by 2002:a7b:ce11:: with SMTP id m17mr7686924wmc.8.1602444805250; Sun, 11 Oct 2020 12:33:25 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id i14sm20536215wml.24.2020.10.11.12.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Oct 2020 12:33:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition Date: Sun, 11 Oct 2020 21:32:29 +0200 Message-Id: <20201011193229.3210774-11-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org> References: <20201011193229.3210774-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-block@nongnu.org, Stefan Berger , qemu-trivial@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Corey Minyard , Paolo Bonzini , John Snow , Richard Henderson , Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Reitz , qemu-ppc@nongnu.org, Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The IDE controller uses IRQ #14 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé Acked-by: John Snow --- include/hw/isa/isa.h | 1 + hw/ide/isa.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 43cdc3c47b6..05622ee11e2 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -17,6 +17,7 @@ enum IsaIrqNumber { ISA_IRQ_RTC_DEFAULT = 8, ISA_IRQ_NET_DEFAULT = 9, ISA_IRQ_MOU_DEFAULT = 12, + ISA_IRQ_IDE_DEFAULT = 14, ISA_NUM_IRQS = 16 }; diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 6bc19de2265..2412d568937 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -108,7 +108,7 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq, static Property isa_ide_properties[] = { DEFINE_PROP_UINT32("iobase", ISAIDEState, iobase, 0x1f0), DEFINE_PROP_UINT32("iobase2", ISAIDEState, iobase2, 0x3f6), - DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, 14), + DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, ISA_IRQ_IDE_DEFAULT), DEFINE_PROP_END_OF_LIST(), };