From patchwork Wed Feb 15 16:16:24 2023 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: 653713 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431240wrr; Wed, 15 Feb 2023 08:18:20 -0800 (PST) X-Google-Smtp-Source: AK7set9zlHn5cuz7NM4lard/5pu4KM2OVefleGkFKExznf7PFKqWS7AslvJZ1ipglJwR9Ay24fMm X-Received: by 2002:a05:6214:29ea:b0:56b:f017:c2e4 with SMTP id jv10-20020a05621429ea00b0056bf017c2e4mr3558865qvb.47.1676477900499; Wed, 15 Feb 2023 08:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477900; cv=none; d=google.com; s=arc-20160816; b=zqjT+DyQI6yjTKwsAnY41PdiuV5XA4Mj/SHQSbgmQ14MMz7CMgtkMq7ztVUL+n+lpt Pwy8gjpc8p+q9SGhGUeacoDcPuAUw1LxeA1dksx25ea44Fccf63ek9J90RTTYTHcfyAw e2uYvghK/fyQuqjXEMFiJZV8g561IJEtIoF8c836yGlDuYw7Af8EpLwFnaFPz6JZVDJs DjTgsDTlSq1SaQn2uLEDafw9VdOEOUh1BD6eCxUV1wtJ0pd/SvTj8ZKG60G4vaZzlD2J gKPR2yaK292zPEBG+GueqWTHy3T2/8KdVaSRX3aNpIKVqLIocnju4Hq2Der+3PASQbF8 RBOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yHQyFWJ9e+LELEF6P8mJecAKwVQHuIPaArP4zvDKZCY=; b=tGMZGr/D4VzfGyxJeOvNPTiQipaqlCHPH2J5vDgv0s2R/BXvCqNuI4UU9WIH/W6V8r 4A7W6qGkObW/6qrZyEb1NeCUcyDRbo4RaDgX/tw/DTntyapncjmJwT+GQX817urr2Z8c VT/RPdgFtOOGgnjuNf5k6SCoMI0o5qZ2U/3yqaBeLE+0GoOwfumfsU7pf5//R/E8+9aR ul7/QK2961VOqrCHSg0A4bjrKSipySyJ5FpufU48OqtEBew/rKfSMFNtO59USjEivngy pVYY3GM5a+BAUCHpW8e1nAYQ8AXT2MIvfq+uMGgi3fnJUJo99CBDNo5t4SlEQLTpR/0Q 91AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXOOtKTb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d2-20020a0cb2c2000000b0053539c4883asi6132984qvf.574.2023.02.15.08.18.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:18:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eXOOtKTb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKSk-0006gr-Lv; Wed, 15 Feb 2023 11:16:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKSj-0006ft-7q for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:16:53 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKSg-0008Cs-GT for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:16:52 -0500 Received: by mail-wm1-x332.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so2639318wmp.1 for ; Wed, 15 Feb 2023 08:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yHQyFWJ9e+LELEF6P8mJecAKwVQHuIPaArP4zvDKZCY=; b=eXOOtKTb2mrOKpdDpoR8HS5FzJVJZddjtQ1bU8NGxAmPmwIYV5WUDBYYTwZVGi8YVT ulUMrGNXBRLxSSzjR4irR5wULPCcNkWmXXjiDcZ3KMd4yH4IFssa/0YRCoClWT3wf/Ak CNm82EBMrJ3Kz6tpfdMN3Ucq8uM2Y0bY9DDmQOC0IQ8bNnB+m1OteOlArg3LOkQrrpHB sI1cQdR5kZ2xQiyt32N2s+hbwEWoOkdoH3vjloVFrw6Ok5Tilite1bV4oOwai7SwyKyk PdT9VWgU9TfIJcKvqzmzmtuM8SRP73OYd1hb7oo1xNJjJB9t1Z4Naube8y6pF9fknsCS anaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yHQyFWJ9e+LELEF6P8mJecAKwVQHuIPaArP4zvDKZCY=; b=seZWVv4cP5iepdtzMLw+sdX6weDRR/VZcbMuaEbm8wkf0qCNNH8rug1rOo8cYHpjGf aD9yeU+7ORZjL/utsPwGTE0B+kXUScTr1PY92CiciGAjclmAPMGE4fQv+wKKxun44CXG qzg6keYIxiBaCfVUYrdZAWOy0LSX+4Cfd6lAkadSSaQFgrcNJJcxfEAIVE+RfAPg+oWC jexZBjvjndyPGWPlMI5zoIPykeSfaetnoMa8uOOGIjOcZvVAKyMjbk1RZPswgew93VvQ 3ilUlFRgDBmOWzLEBNI6nvJwhlr2IlNt+uKSTImbLWQYo1BF0aGC/LEZ5zLfE8nRzEAy nkUA== X-Gm-Message-State: AO0yUKXNZWhI9goPCz6tvJVJym8MlH8m77gvV2QI0J+r0CNvz7h3hor+ VoVAjSdMU90FaX1R9kk9B+eSYSrSc/bWnWD0 X-Received: by 2002:a05:600c:2b0f:b0:3dc:4633:9844 with SMTP id y15-20020a05600c2b0f00b003dc46339844mr2818954wme.17.1676477808869; Wed, 15 Feb 2023 08:16:48 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003dc4aae4739sm2444929wmc.27.2023.02.15.08.16.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:16:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 01/18] hw/isa: Rename isa_get_dma() -> isa_bus_get_dma() Date: Wed, 15 Feb 2023 17:16:24 +0100 Message-Id: <20230215161641.32663-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org isa_get_dma() returns a DMA channel handler from an ISABus. To emphasize this, rename it as isa_bus_get_dma(). Mechanical change using: $ sed -i -e 's/isa_get_dma/isa_bus_get_dma/g' \ $(git grep -l isa_get_dma) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/audio/cs4231a.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/sb16.c | 4 ++-- hw/block/fdc-isa.c | 2 +- hw/dma/i82374.c | 2 +- hw/isa/isa-bus.c | 2 +- include/hw/isa/isa.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index 7f17a72a9c..ec066fcd89 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -671,7 +671,7 @@ static void cs4231a_realizefn (DeviceState *dev, Error **errp) CSState *s = CS4231A (dev); IsaDmaClass *k; - s->isa_dma = isa_get_dma(isa_bus_from_device(d), s->dma); + s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->dma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 42f010b671..2a08a0f7d7 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -240,7 +240,7 @@ static void gus_realizefn (DeviceState *dev, Error **errp) IsaDmaClass *k; struct audsettings as; - s->isa_dma = isa_get_dma(isa_bus_from_device(d), s->emu.gusdma); + s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->emu.gusdma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 2215386ddb..ae745c7283 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1401,8 +1401,8 @@ static void sb16_realizefn (DeviceState *dev, Error **errp) SB16State *s = SB16 (dev); IsaDmaClass *k; - s->isa_hdma = isa_get_dma(isa_bus_from_device(isadev), s->hdma); - s->isa_dma = isa_get_dma(isa_bus_from_device(isadev), s->dma); + s->isa_hdma = isa_bus_get_dma(isa_bus_from_device(isadev), s->hdma); + s->isa_dma = isa_bus_get_dma(isa_bus_from_device(isadev), s->dma); if (!s->isa_dma || !s->isa_hdma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index fee1ca68a8..a5f07b668d 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -98,7 +98,7 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) fdctrl->dma_chann = isa->dma; if (fdctrl->dma_chann != -1) { IsaDmaClass *k; - fdctrl->dma = isa_get_dma(isa_bus_from_device(isadev), isa->dma); + fdctrl->dma = isa_bus_get_dma(isa_bus_from_device(isadev), isa->dma); if (!fdctrl->dma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 34c3aaf7d3..63734c22c9 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -125,7 +125,7 @@ static void i82374_realize(DeviceState *dev, Error **errp) I82374State *s = I82374(dev); ISABus *isa_bus = isa_bus_from_device(ISA_DEVICE(dev)); - if (isa_get_dma(isa_bus, 0)) { + if (isa_bus_get_dma(isa_bus, 0)) { error_setg(errp, "DMA already initialized on ISA bus"); return; } diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index f155b80010..39111f74cc 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -99,7 +99,7 @@ void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16) bus->dma[1] = dma16; } -IsaDma *isa_get_dma(ISABus *bus, int nchan) +IsaDma *isa_bus_get_dma(ISABus *bus, int nchan) { assert(bus); return bus->dma[nchan > 3 ? 1 : 0]; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 25acd5c34c..029d6e90bf 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -77,7 +77,7 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs); qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); -IsaDma *isa_get_dma(ISABus *bus, int nchan); +IsaDma *isa_bus_get_dma(ISABus *bus, int nchan); MemoryRegion *isa_address_space(ISADevice *dev); MemoryRegion *isa_address_space_io(ISADevice *dev); ISADevice *isa_new(const char *name); From patchwork Wed Feb 15 16:16:25 2023 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: 653711 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp430802wrr; Wed, 15 Feb 2023 08:17:28 -0800 (PST) X-Google-Smtp-Source: AK7set9VUw+zmG/T9uJHDuCFUG2EP7t+STBbvj/qImU8Y9rFKYGJ1aLBcB+RRT59qdQJ0pwVG1pA X-Received: by 2002:ac8:5c52:0:b0:3b8:60b9:e75e with SMTP id j18-20020ac85c52000000b003b860b9e75emr4761017qtj.4.1676477848222; Wed, 15 Feb 2023 08:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477848; cv=none; d=google.com; s=arc-20160816; b=u2BGwJF9GBA0ZnyQqUp5+TY206JGuspH5aPOpoLAbZwSMbNFb5bKWqmLET5WduF+Rb R2Jl7ZSIWR/JvSWJmk+xjmbtR0pppcW0qs0E92E13kUcFg0ER88mMcZ+GvQu2QKrfZjl A+xvEmkXU4c34RKkbuujrs9/ZPrvVjWRSAE+qaxNZkgfKP6k0CEopf6lQVu4vpNi7XfI vkWsgTbh9wIJjpXrObJH1Gd8kZ1/Cipu7rcho/KKeypO7y8zfFg1z8qJcYwKfqMFSJkO uCtKQKTvouzgT5lxFF6oV6vOjnfqW40akB+WyxBAZv0/MXLTjsVlwbqGysHyCAcNVmcc wGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mpaucak1aQmulfVfVCcPQMicTcUylx2TFk7k+IDFyYk=; b=J3Ba1zhaCZxtg6MFfJKdtNBBVaPEL005IZNJqZqumVWkRXS84UayxInLJ9OHh5e9vf 9qTW2A64mxmL3qg91iHvwS+s8bYiaF+N/LhoNzJTl2GsuHkrZn0Clyn+Pzvo0jlDOYx2 0ynm3RWOAMhv6DEU74Wr0bZFjwNznx3drj0MFZ+LKt3tA7cHB+0bZNEEj6SmowK9Ep1m Rrmi3H0/kpgGnH9faOSOEYtsQxZv4KNl6D2AHjyyBW1F4xmzE613+yZiHvgiNhixrOYS YW6jjMF+8Zf0gL+Os9ODeER53dVZOM2huxOaKv2vrQeLPgZIYoBQqdhn+vs4qVvSqMAX T59w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzNxJgeA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e4-20020ac84e44000000b003bcf7d8df93si2018134qtw.431.2023.02.15.08.17.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzNxJgeA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKSq-0006iU-O4; Wed, 15 Feb 2023 11:17:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKSn-0006hJ-UV for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:16:59 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKSl-0008DV-RP for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:16:57 -0500 Received: by mail-wr1-x433.google.com with SMTP id a2so19721095wrd.6 for ; Wed, 15 Feb 2023 08:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mpaucak1aQmulfVfVCcPQMicTcUylx2TFk7k+IDFyYk=; b=vzNxJgeAW5TWKiCbx91NPPVbBzqTSMDdaTRSluzwnietRBwS+3uoms4M2jQxjcZ60t 76okLr1vs3BVQhkFi11Jk7PcUjLTJ9BbLaAH/tPtKDxMlcYnwUyjGvY5BneMf4J/uXHl Ai7w9a9hjNTpwn97ivb+eW8KhUycVTzDG7K0pwWQ8I7efhsfUfleh5kAbiYHOnJIPYkv SaPFsHDOj2BKNb/g1h5dvUVxBW9FDYX9sAokG6mooSHl2TuEKYMIChT31VE2CcSyp1I1 JET4OmXb+LBv+EoBiS6rCfe7pGMGme5pymFfhjQ2MJknRj0J+gUHoG/2a3ABfOm6zwPR MafQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mpaucak1aQmulfVfVCcPQMicTcUylx2TFk7k+IDFyYk=; b=RKJg2ur9AnZGyZK7+bwLEYE6Ea9+0JX7Kxp57Wam1GAFZlAJkbTHAAkThNsF8zlWCx S/iX7Qwa+QpI0XOmrqLSF+4PMot3DJAHFQCcOEzHYwsbjUAoJFvfLOZC26Gl52+Is9jf cyyJKYPpFv2ItLyJYjd61hfVsFvhmhJiKpv8Xp/7GwPP8mGem2j3QSWQupyq42pItP0A XJmOIsbrLJ5+VxNnBBJBr7pu/ANZY8Pi9TiXddY9hxVS2CzKHxW6A8ZAdX2GehJQETGE uipUgcNu2n0zgn6YITqUitKFrL26/LCoZl9jVJzssTgCkaW8ep9KPLdkdkqih9K9vrkR bPQA== X-Gm-Message-State: AO0yUKVuB0G6m7v5i8SI1q79/ebG1LPNE/fbvzIkKbQDshZNn+EctBAF OY56fl5v/XJukyGLLbJ/u9ZFQAdlRIHpaYbo X-Received: by 2002:a5d:6aca:0:b0:2c5:588f:84a0 with SMTP id u10-20020a5d6aca000000b002c5588f84a0mr2220724wrw.3.1676477814254; Wed, 15 Feb 2023 08:16:54 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id w1-20020a5d4041000000b002c546d169ddsm14286036wrp.11.2023.02.15.08.16.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:16:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 02/18] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq() Date: Wed, 15 Feb 2023 17:16:25 +0100 Message-Id: <20230215161641.32663-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org isa_get_irq() was added in commit 3a38d437ca ("Add isa_reserve_irq()" Fri Aug 14 11:36:15 2009) as: a temporary interface to be used to allocate ISA IRQs for devices which have not yet been converted to qdev, and for special cases which are not suited for qdev conversions, such as the 'ferr'. We still use it 14 years later, using the global 'isabus' singleton. In order to get rid of such *temporary* interface, extract isa_bus_get_irq() which can take any ISABus* object. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/isa/isa-bus.c | 14 ++++++++++---- include/hw/isa/isa.h | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 39111f74cc..96bfee9aa7 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -72,6 +72,13 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) bus->irqs = irqs; } +qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum) +{ + assert(irqnum < ISA_NUM_IRQS); + assert(bus && bus->irqs); + return bus->irqs[irqnum]; +} + /* * isa_get_irq() returns the corresponding qemu_irq entry for the i8259. * @@ -81,14 +88,13 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs) qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) { assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); - assert(isairq < ISA_NUM_IRQS); - return isabus->irqs[isairq]; + return isa_bus_get_irq(isabus, isairq); } void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) { - qemu_irq irq = isa_get_irq(isadev, isairq); - qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq); + qemu_irq input_irq = isa_get_irq(isadev, isairq); + qdev_connect_gpio_out(DEVICE(isadev), gpioirq, input_irq); } void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 029d6e90bf..42d36b21a3 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -80,6 +80,14 @@ void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_bus_get_dma(ISABus *bus, int nchan); MemoryRegion *isa_address_space(ISADevice *dev); MemoryRegion *isa_address_space_io(ISADevice *dev); +/** + * isa_bus_get_irq: Return input IRQ on ISA bus. + * @bus: the #ISABus to plug ISA devices on. + * @irqnum: the ISA IRQ number. + * + * Return IRQ @irqnum from the PIC associated on ISA @bus. + */ +qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum); ISADevice *isa_new(const char *name); ISADevice *isa_try_new(const char *name); bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp); From patchwork Wed Feb 15 16:16:26 2023 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: 653724 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432411wrr; Wed, 15 Feb 2023 08:20:41 -0800 (PST) X-Google-Smtp-Source: AK7set8JPvAAOIT853Wt168xLYoS1NUqBFmqGI13LOeOH+w5VmC+VK/r4XB6Dajf5qwIlhr+LyNF X-Received: by 2002:ac8:5f52:0:b0:3b6:895c:d18d with SMTP id y18-20020ac85f52000000b003b6895cd18dmr4326922qta.15.1676478040914; Wed, 15 Feb 2023 08:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478040; cv=none; d=google.com; s=arc-20160816; b=krbyJz9yiyzQ9vq063RZSfem3qSn2/waqWb/kDutojfYHW/jZXK/RBurz3YutGdsWb ljMTxty61bnqPNNadM4CVhNWOmjchs0ESVQo8wSLUTwj6NgXE6/hlAtE/qbfwApTGa4X /c2XnDB2QLJiPm+ktO8vxvlg9aoRlT+9hQoVDyHREER9V3E/w897gt+ELqCwrVVrt7kl Ni43zbUk7c6CusLfTgJmes+abofTXh+iVYWJcdx4ZxOIYGMS1cickZLOtQmUsuCpS2+j hbNwY0kBQTSig51bc+krrQ+OasrGCNBHUGOXNNeQywGrhIZTTUmga+/MdJuHCfhUBEsl oSeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=v8RtrrvO+M++8XqHDIPlbpLfPRDEsTnCEKMBVdo6hIBwQOrXQsEbZGs1Xr0nGbgI6l nrNi5YC9z52CFA9ZSbaKMcF0u7CR38YJXyVh+SRLSm55DjDDP9pfLiuW7xqGQ5bv/Bzo fkr82+XigER5TkrRreRkYQNmMIcjrRzmMv8mniHsKei1jAfT7eZFx7IhgAuwL5+UpEY3 tezfSeOYxfJL2QCVd3pgGssqoZMg/9r609oVODr4wmqbKYHzfHawpw/zVSpPUXHFmJbr 0GjTJYFvRzEGnz6ql8hkMHkbYGH6/Ok8TdUB5masr2hCH1ure+5H1b3dLmBRKoZka83K e9HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j9C/qfwu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r16-20020ae9d610000000b006f9720b5fcbsi13549555qkk.79.2023.02.15.08.20.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="j9C/qfwu"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKSv-0006tr-GN; Wed, 15 Feb 2023 11:17:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKSt-0006pO-Mh for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:03 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKSr-0008E9-0g for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:03 -0500 Received: by mail-wr1-x433.google.com with SMTP id bk16so19691585wrb.11 for ; Wed, 15 Feb 2023 08:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=j9C/qfwuaSY84DVpkM/QMdfNL5zMIzi6N5zJ8Sxos3o25H1LunWSHRNvGRwDmrQjh6 bCB8j9TPw/G2mffdiAmUBJZB1D2PdPVg4hPp7qeAD6SGlvhek8ZGUCHfQrV34gNdOfW5 EuqNF2jEeGdmqHx6hoowVD3YndCKMzZpZnDPfdDQGIFxtbZesi/rdk4G+ap0HYGtnUIc SrGxiqhwHzSmiFR6CpoSMKQEiz7JMrB9d/eitQilQiZTAdFHAT25t6C3HJDLVlD/H02S nndMtBpD7nl0qV0QtMpjvutrJ5qKBgPXhDzdlsB6I3MTwxdOZJ7uA7+DxwNnyjxRlM1w yW2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bsue9yzBhWnK03QiHXdQ18DMQdX8cZwXb/MfHrsKq6M=; b=jg2zbRO0Czd0txkig/TmdWSMNy9VDawpb9JuzEGsAiambFYmgle0CZJBhpgZutizCG vSfTsVXfZK5ohEuEvWqY8CF67/b8Gm7dXmBhYJAREwmuM+C9I6dwDi8mEV3WVK/t88IB jDV1za53kWC1o/PH8wim8dHtjDhWV5acCJI5Fz3BQ4Eh3fItXvsPqZrmht0HWoZwLoZj 3R6O2LI0GiqKZIT7UPCynOJUh4CQqppPMsISQR9RwEdbaaZ2c26pP2ERR+F0BO7MWjXY k81ldHDnA5XnLBM9CTvwujgyKy41Lg9LkJikWJKRW669nZOIRXbSkZZfd0Nb0XM4UwSV v1Jw== X-Gm-Message-State: AO0yUKVpV7l3I+Y8mwaqkggCqUYuFBzVBKcKG7ca5bxgD+rJiWdhfYQw X7pyL/TxrXbpSZRxIcf+hnMx/13tlqV1fYGW X-Received: by 2002:a5d:4101:0:b0:2c5:53e6:9aba with SMTP id l1-20020a5d4101000000b002c553e69abamr1950617wrp.5.1676477819612; Wed, 15 Feb 2023 08:16:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d2-20020adfe2c2000000b002c3f7dfd15csm15957221wrj.32.2023.02.15.08.16.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:16:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 03/18] hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available Date: Wed, 15 Feb 2023 17:16:26 +0100 Message-Id: <20230215161641.32663-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/audio/cs4231a.c | 5 +++-- hw/audio/gus.c | 5 +++-- hw/audio/sb16.c | 7 ++++--- hw/block/fdc-isa.c | 5 +++-- include/hw/timer/i8254.h | 3 ++- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index ec066fcd89..5c6d643732 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -668,16 +668,17 @@ static void cs4231a_initfn (Object *obj) static void cs4231a_realizefn (DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE (dev); + ISABus *bus = isa_bus_from_device(d); CSState *s = CS4231A (dev); IsaDmaClass *k; - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->dma); + s->isa_dma = isa_bus_get_dma(bus, s->dma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; } - s->pic = isa_get_irq(d, s->irq); + s->pic = isa_bus_get_irq(bus, s->irq); k = ISADMA_GET_CLASS(s->isa_dma); k->register_channel(s->isa_dma, s->dma, cs_dma_read, s); diff --git a/hw/audio/gus.c b/hw/audio/gus.c index 2a08a0f7d7..787345ce54 100644 --- a/hw/audio/gus.c +++ b/hw/audio/gus.c @@ -236,11 +236,12 @@ static const MemoryRegionPortio gus_portio_list2[] = { static void gus_realizefn (DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE(dev); + ISABus *bus = isa_bus_from_device(d); GUSState *s = GUS (dev); IsaDmaClass *k; struct audsettings as; - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(d), s->emu.gusdma); + s->isa_dma = isa_bus_get_dma(bus, s->emu.gusdma); if (!s->isa_dma) { error_setg(errp, "ISA controller does not support DMA"); return; @@ -282,7 +283,7 @@ static void gus_realizefn (DeviceState *dev, Error **errp) s->emu.himemaddr = s->himem; s->emu.gusdatapos = s->emu.himemaddr + 1024 * 1024 + 32; s->emu.opaque = s; - s->pic = isa_get_irq(d, s->emu.gusirq); + s->pic = isa_bus_get_irq(bus, s->emu.gusirq); AUD_set_active_out (s->voice, 1); } diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index ae745c7283..535ccccdc9 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -1398,17 +1398,18 @@ static void sb16_initfn (Object *obj) static void sb16_realizefn (DeviceState *dev, Error **errp) { ISADevice *isadev = ISA_DEVICE (dev); + ISABus *bus = isa_bus_from_device(isadev); SB16State *s = SB16 (dev); IsaDmaClass *k; - s->isa_hdma = isa_bus_get_dma(isa_bus_from_device(isadev), s->hdma); - s->isa_dma = isa_bus_get_dma(isa_bus_from_device(isadev), s->dma); + s->isa_hdma = isa_bus_get_dma(bus, s->hdma); + s->isa_dma = isa_bus_get_dma(bus, s->dma); if (!s->isa_dma || !s->isa_hdma) { error_setg(errp, "ISA controller does not support DMA"); return; } - s->pic = isa_get_irq(isadev, s->irq); + s->pic = isa_bus_get_irq(bus, s->irq); s->mixer_regs[0x80] = magic_of_irq (s->irq); s->mixer_regs[0x81] = (1 << s->dma) | (1 << s->hdma); diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index a5f07b668d..7ec075e470 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -86,6 +86,7 @@ static const MemoryRegionPortio fdc_portio_list[] = { static void isabus_fdc_realize(DeviceState *dev, Error **errp) { ISADevice *isadev = ISA_DEVICE(dev); + ISABus *bus = isa_bus_from_device(isadev); FDCtrlISABus *isa = ISA_FDC(dev); FDCtrl *fdctrl = &isa->state; Error *err = NULL; @@ -94,11 +95,11 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) isa->iobase, fdc_portio_list, fdctrl, "fdc"); - fdctrl->irq = isa_get_irq(isadev, isa->irq); + fdctrl->irq = isa_bus_get_irq(bus, isa->irq); fdctrl->dma_chann = isa->dma; if (fdctrl->dma_chann != -1) { IsaDmaClass *k; - fdctrl->dma = isa_bus_get_dma(isa_bus_from_device(isadev), isa->dma); + fdctrl->dma = isa_bus_get_dma(bus, isa->dma); if (!fdctrl->dma) { error_setg(errp, "ISA controller does not support DMA"); return; diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 3e569f42b6..8402caad30 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -56,7 +56,8 @@ static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq, qdev_prop_set_uint32(dev, "iobase", base); isa_realize_and_unref(d, bus, &error_fatal); qdev_connect_gpio_out(dev, 0, - isa_irq >= 0 ? isa_get_irq(d, isa_irq) : alt_irq); + isa_irq >= 0 ? isa_bus_get_irq(bus, isa_irq) + : alt_irq); return d; } From patchwork Wed Feb 15 16:16:27 2023 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: 653728 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432638wrr; Wed, 15 Feb 2023 08:21:05 -0800 (PST) X-Google-Smtp-Source: AK7set9dJ8sue2oT3ytXjqtVpyFoT50U/jm4pfgmsopEW2h4LEDv5PUZArhdT0e3SpHBIAYKLgEO X-Received: by 2002:a05:6214:f2b:b0:56e:8f23:d2b9 with SMTP id iw11-20020a0562140f2b00b0056e8f23d2b9mr7513457qvb.22.1676478064936; Wed, 15 Feb 2023 08:21:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478064; cv=none; d=google.com; s=arc-20160816; b=ZDHp18gewxhlLKape3aLwqeCIz95jI5sebzQyRrMjwn4CEpByxStPhQSilstM+H0cB +tqZ6TqgA5quIBHEzfCNrSZ+/5HsFog02xSl22uPR5e59bj5GCpfb3Ui5/h8wlAvT3vC 3ry3ltn05A78uv4RsjFK08EnsElVnA8Tle4ulDIA61CjfU9LwpGJ+r/F+5u1dpi2P52s +oL5P/xv0Cv83MCDOYShf4N9A4cl6tFLbRlKhtlJ/+++5nzV0tNo+32c2gpnpGAGq43E A0+wXFP1U8ulioi8WMPi6+6+9nHKFHbjfaXXfHK82aYGJPxGM6ipyuQhu8ms8rVZ4QcX IGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tln1lJc5WLQnNDFCja/omy1A0TTOLj6p3aQJ0P1Gb3g=; b=RTrzYA4XIFO7xX7cpltHIUfR3/79t7ZkpPj2SbZXxUpk+eUrNC0lgFl/2cxHgV/s3T c59VLF+cZR+aylvkZvGrYi8jhP5/uRZvx5eFJjLEYV5Y4+62WztAf3e1iJfWmnTUpq/f dvLkij+U1U9FHawku7isf/zCUOAVhu5H3Lrm9bk9h0QjoD0NbjPvjGPb2qCchiB0dJ2X xUfD0geXYGYNhgI32axVBgqQXbkDug/hcJUlaD2KfhYHd74xdpW1ZYvGTRQtoDU6mGmU qnh3sjsoDTPUxbFiNGxP40q3r+thf/Z+MbFCbAwl2a7bX/rr6wM6DJfrBwOr/YC+8kg7 boCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mD/DHKDD"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z76-20020a37654f000000b007065816b171si13704833qkb.371.2023.02.15.08.21.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:21:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mD/DHKDD"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKT6-0006zO-EY; Wed, 15 Feb 2023 11:17:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKT1-0006y5-0F for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:12 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKSw-0008Fx-DB for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:10 -0500 Received: by mail-wm1-x333.google.com with SMTP id r18so13711785wmq.5 for ; Wed, 15 Feb 2023 08:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tln1lJc5WLQnNDFCja/omy1A0TTOLj6p3aQJ0P1Gb3g=; b=mD/DHKDDPVoqDx2HsPpa56A8KR0aKPRd+Q71camruv7ltmphAld2I6/9ZV3lEjbLpp 1022bhXAVVDus0hJclTdw2CXSJxVryEwbgFSoDCYl289W34gJ52Z5ehvlvtCIU6I8uC7 SRqA0PD6wLQqiRPA5bQOeMvuEEsnVfFtCMtBRHLCSRjhanjO2JVvhyZn6Dvy0GzeMvlw S0p8j53Ys+J1H1cBzQu2FvSKpI4GEQtfVOQOBw1EyXsdyQAD1HjkMgnD6dVn5M78wCwb xywudPq5xVOA6c1ndfxv1TKf2VCHNZKmesRD2o8bxNyaq4H2ig4WE10Dt6Cgc6xvAElj x6SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tln1lJc5WLQnNDFCja/omy1A0TTOLj6p3aQJ0P1Gb3g=; b=XAFTPSFQ/bil+qufgztIleznBQCzJyzoXCNR09TJPoGrTxQ3eqM0qcPnH7T5mZ7g1r 4o64um3JRxtr4CWF672HH/rxUKD8IvzglXMTggwCdhKOAyMxnRWalwai0En23vkgb6Uz G/XRz71C9D+qucnfkMPSi4xNly+XmnL6pi8NJFFLZqQXnyNWU+L5Waojf15LiRlTJ7/b /Ggz5hM7/f4fzYt7+A+NK1bajNz4MiSTmGJsUoy2gCZyITE5Ph1gToF7mRoNmP+ZoRAb CQHUq71X3P1vKYvOjAhAek/p18QWhjN6+gL8+Qr8KvK/n/scRAG3brUoSjqZdMqMcnYT VUXg== X-Gm-Message-State: AO0yUKWnAph5LJ2oIuFaxilz6wc2EWf5w9OscAPPx31Oercuzn76kSSa 7QYjJx82tt+EwrPfaZIl7xwITpHWroe3f31l X-Received: by 2002:a05:600c:705:b0:3df:f9e9:7600 with SMTP id i5-20020a05600c070500b003dff9e97600mr2483452wmn.25.1676477824797; Wed, 15 Feb 2023 08:17:04 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r128-20020a1c2b86000000b003dff2b493c8sm2662781wmr.36.2023.02.15.08.17.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 04/18] hw/ide/piix: Expose output IRQ as properties for late object population Date: Wed, 15 Feb 2023 17:16:27 +0100 Message-Id: <20230215161641.32663-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 14 ++++++++++++-- include/hw/ide/pci.h | 1 + include/hw/ide/piix.h | 4 ++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 41d60921e3..9d876dd4a7 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -121,6 +121,13 @@ static void piix_ide_reset(DeviceState *dev) pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */ } +static void piix_ide_initfn(Object *obj) +{ + PCIIDEState *dev = PCI_IDE(obj); + + qdev_init_gpio_out_named(DEVICE(obj), dev->irq, "ide-irq", 2); +} + static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) { static const struct { @@ -133,6 +140,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) }; int ret; + qemu_irq irq_out = d->irq[i] ? : isa_get_irq(NULL, port_info[i].isairq); ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, port_info[i].iobase2); @@ -141,7 +149,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) object_get_typename(OBJECT(d)), i); return false; } - ide_bus_init_output_irq(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq)); + ide_bus_init_output_irq(&d->bus[i], irq_out); bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus = &d->bus[i]; @@ -162,7 +170,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error **errp) vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); - for (unsigned i = 0; i < 2; i++) { + for (unsigned i = 0; i < ARRAY_SIZE(d->irq); i++) { if (!pci_piix_init_bus(d, i, errp)) { return; } @@ -199,6 +207,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) static const TypeInfo piix3_ide_info = { .name = TYPE_PIIX3_IDE, .parent = TYPE_PCI_IDE, + .instance_init = piix_ide_initfn, .class_init = piix3_ide_class_init, }; @@ -221,6 +230,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) static const TypeInfo piix4_ide_info = { .name = TYPE_PIIX4_IDE, .parent = TYPE_PCI_IDE, + .instance_init = piix_ide_initfn, .class_init = piix4_ide_class_init, }; diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index 7b5e3f6e1c..548e539add 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -49,6 +49,7 @@ struct PCIIDEState { IDEBus bus[2]; BMDMAState bmdma[2]; + qemu_irq irq[2]; uint32_t secondary; /* used only for cmd646 */ MemoryRegion bmdma_bar; MemoryRegion cmd_bar[2]; diff --git a/include/hw/ide/piix.h b/include/hw/ide/piix.h index ef3ef3d62d..533d24d408 100644 --- a/include/hw/ide/piix.h +++ b/include/hw/ide/piix.h @@ -1,6 +1,10 @@ #ifndef HW_IDE_PIIX_H #define HW_IDE_PIIX_H +/* + * QEMU interface: + * + named GPIO outputs "ide-irq": asserted by each IDE channel + */ #define TYPE_PIIX3_IDE "piix3-ide" #define TYPE_PIIX4_IDE "piix4-ide" From patchwork Wed Feb 15 16:16:28 2023 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: 653725 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432445wrr; Wed, 15 Feb 2023 08:20:43 -0800 (PST) X-Google-Smtp-Source: AK7set8xwg61q4TokZz3LJIS6n97gD6dpmuz49572znjf8Po6HAwPB16UklvAnXG24+ihpYdBJV5 X-Received: by 2002:a05:6214:248b:b0:56e:adaf:5e10 with SMTP id gi11-20020a056214248b00b0056eadaf5e10mr5326009qvb.21.1676478043215; Wed, 15 Feb 2023 08:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478043; cv=none; d=google.com; s=arc-20160816; b=KFMH5zjff2qMobcrcdsrV14GcwZwIbN5zZ0ZXsJ2AoWoBBOAzJj31QhJj1b/qgYScZ pkLCOgn89RPR/bwflTjACB01+4pPdw82YxP+37X7a8VZ8gdNM0u5NO57JnF/LzEp4KCk B2xXuPNnyG7z6tOsC3LpCYwDnbazez+va86LwIA9nqQQQKyUcNjbVgNZGAdRLAO+ksBx WGJGqkt30+rxWFVfT9goHTPGTuT3RS0SCAvEGyhRXhs46t2VGcPKJ0+tOqNgWMFCxdkg KicRPI7L4NOebFKleFRny/6INSE9gyb+/E+4yYXsNkoP4PHLtfQmOc5JI5RYu9aq5O+Y 42vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bX94LAhKXIsTrF88ApJCd14czN1lbFutyRtESU1HH4c=; b=mdJXa0HDB5fTdvJ1S4r4B6coBVDnkhsVYzwnvUo+3EOTYhffHYuXdjNJBeA2xkc1YO f90verP/pQJxNyPOzhXKA2x6sGeNEtTwP57JUeGws5SvKgBPTpZilqfzpGbQtUYfeMz/ WdK1+wRmLSWERaioeMML29RMWcS9IyUEibXKH99RQEC93mEJrXiiP6tOfgQ3xUBWYUNC wcUHaLWtzSm7SWYIS+/0GobaQtQpEM11N0FHiUiJO+TL78stQJhl2kIo/3UUaS0G3K7Y JcVIl/l9IlGd8lulH0VhqZGqMPVOS+FqyNcNCf5Ei1djcFopRtRAzH5Uwru8OUXnIJNQ 4imA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U9gcUplE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i8-20020a0cf388000000b0056ea366133esi8569647qvk.571.2023.02.15.08.20.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U9gcUplE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTD-00071Z-5K; Wed, 15 Feb 2023 11:17:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKT3-0006yf-6U for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:13 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKT1-0008H3-Lj for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:12 -0500 Received: by mail-wm1-x333.google.com with SMTP id o36so13739600wms.1 for ; Wed, 15 Feb 2023 08:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bX94LAhKXIsTrF88ApJCd14czN1lbFutyRtESU1HH4c=; b=U9gcUplE2QGhzIEBwDNzBI7wxI1m9FrgknIW2X5+YETPPnPRYzPulLNLeDCJ4Wd8y7 on0wqxhabITPfHynVP5+QGOp8nltp4ceNnZ/KuRI6tro7CP/9+aBmZek2HknNRck8IXF N8AQsfS/yFxrO1/6MgRT/hVmFdo1MKMwwzE3G330OGLzHDahK5WJuMnGhKeuSF/spJ4S vT2wUF2nRN0k76AUbQVvjO9C6hsgnPhchg7ULjIHuu/PZ/YoES98/N59R0ZF/fLb4XDy S5a0ZrUm9zgq70j6kIq9003UpLpObqMmoT5uEIPRJTxtLzWnQ94v6O4vWVh4p/2mTkXj srjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bX94LAhKXIsTrF88ApJCd14czN1lbFutyRtESU1HH4c=; b=Y8y1jFjhm+onjQzbCsxMBF1QNa0wX9qiFJ7tWLtldDO7nHKedYhO1/HN+ZBppHLuvF LaZhf6ipUJqbvYD7NNz0MWhIeN20ool6WQarosh4V5a0A88snM9tm1hfH4zrGCSs74P5 DLiinvsbvL+nDuDQhyuysfHu2hfjPf+z21DNPDjeaAztIliUEnV/xPC+pAUSq548rfgJ bbz70ibTlWZCGav+btoBsnNACBR+Os3rKt2QuSZWqqAt8jg7vIBeQEjKQsFjSnds1TZj jnntnDZvbGHLr+y7D38bAcd1pxCkKMm6h5nBdDSFqdBlKI7bWL+WxoaUf966CgRV+Opo ZuNA== X-Gm-Message-State: AO0yUKUVdABHyDp/84Vp751jHUdtjuTNCvrQ6RqgwQRHN9go5UEeLvH+ /9A43HQuUvZ120KJKe4sIfsUg+cTxo9WbfSK X-Received: by 2002:a05:600c:3b9b:b0:3e2:669:757 with SMTP id n27-20020a05600c3b9b00b003e206690757mr1389930wms.10.1676477830222; Wed, 15 Feb 2023 08:17:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r4-20020a05600c35c400b003df245cd853sm2718304wmq.44.2023.02.15.08.17.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum Subject: [PATCH v2 05/18] hw/i386/pc_piix: Wire PIIX3 IDE ouput IRQs to ISA bus IRQs 14/15 Date: Wed, 15 Feb 2023 17:16:28 +0100 Message-Id: <20230215161641.32663-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since pc_init1() has access to the ISABus*, retrieve the ISA IRQs with isa_bus_get_irq(). Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7085b4bc58..983baf0211 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -277,7 +277,13 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PCIDevice *dev; - dev = pci_create_simple(pci_bus, piix3_devfn + 1, TYPE_PIIX3_IDE); + dev = pci_new_multifunction(piix3_devfn + 1, false, TYPE_PIIX3_IDE); + qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", 0, + isa_bus_get_irq(isa_bus, 14)); + qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", 1, + isa_bus_get_irq(isa_bus, 15)); + pci_realize_and_unref(dev, pci_bus, &error_fatal); + pci_ide_create_devs(dev); idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); From patchwork Wed Feb 15 16:16:29 2023 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: 653720 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431930wrr; Wed, 15 Feb 2023 08:19:37 -0800 (PST) X-Google-Smtp-Source: AK7set9PwZac7eYIdtJjL3iLkD2BoFCIHHslAeMqlh2t5B9ONTcl8Ff6IxJz0w2yRpjhOTP02UlR X-Received: by 2002:a05:622a:343:b0:3b6:5fc7:f554 with SMTP id r3-20020a05622a034300b003b65fc7f554mr4813885qtw.7.1676477977572; Wed, 15 Feb 2023 08:19:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477977; cv=none; d=google.com; s=arc-20160816; b=nAGl+QwQDuTrI+DRH61RbiowR0Fw9M9waetaYIDxHo9L3bHba2lua5ZYVjFQuCDSWn KW7s+KLWCRW2n9c4nxEHKZbkDuPvDVVsHkcLCk9reNfy3IHSdn4K9NXQRtzELyfHIQeJ moVVNP2ENcpsXqTmSoYUv0xltMEA+TUYM4iurgfgz0YLGlTtyB3qw0LtBvXQyVfYi+kw HyMTylJhQoxdrOX+Wx+nJbtws/ZCHEU0dwwscvAYGLw0anlfhiEXYCD5EMK5rVjfI3BY GeFAJd1FmT5hAGbn1G+pjNzqlFmTJ8xefu+DpS7+KPy1nbrvtj7pZ6xT3iGQQcxLKLPM lgMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fwf3B8Umbt5plQJjIYprPrULazHXeAYCSttsSsG++/E=; b=zrVZsN/2zlacHTcUvKxMzLlgTl+AGOd1YqNrLjfDAgOItgiY2xoZtPYIf6YQKhL+Ll R3HV8CTRnD1njaI6YbXnA5N+JxiUwqQJVqZWpFDAJThbQVDAGlrygW127nD5dZRtW1LB shNU7xEUG9AnVDuXLczwj52MZzA2P1+eV8fdXJspNdOY/lAeRtOoUDm7zup/oK7eiG2Y 8GacpjuK5v+tTyeO3lxr+V3Vuj1EXZBzPeCxzaU1GpnPfZdGwd5ZgXtAQ34XGaH2x8v3 Rv12PMdIv4rtTGmt1pYUyXWWQ2FrJcq2bYlEiK+eNrb8BvUqxUXlDOc/ixOv+pghCqRd RiPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qkGAG7kO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s21-20020a05622a019500b003b832228feasi15140554qtw.289.2023.02.15.08.19.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qkGAG7kO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTG-0007DH-6q; Wed, 15 Feb 2023 11:17:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKT8-00070O-Mf for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:20 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKT6-0008I3-W3 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:18 -0500 Received: by mail-wm1-x333.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso1970865wmp.3 for ; Wed, 15 Feb 2023 08:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fwf3B8Umbt5plQJjIYprPrULazHXeAYCSttsSsG++/E=; b=qkGAG7kOkskl36bFhSWGOdlSEQRpmI/4HMV+IQ1pZgH+vZg70sfuC3QP6M7HO8L4Gi 8loZ9KPxLqz3C/RmeqmIn2Ky9P/5+BH3ajVK2sgEfhS4Y2Zo0M250r9Oc/+wFm27B7kd UuXTY1qB1DNOGd4KOJa2BgSmdkYc2GMX/LOB35/hUfpm7WVzNajR+7E0ZYtk0h1VS37+ h7WREDcdTHG3tgNXtSYB0/QVIeI9I3OnXrOUrKYIj09OTEMjp9ftLN2TCyA1/th6c/BT N92qIgfrUJLaOJ4TuQpVv/bQcYX4bhZFnM3VtLj7CpJJH7zCCyllggkJGbZPQXh+uyLj DU9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fwf3B8Umbt5plQJjIYprPrULazHXeAYCSttsSsG++/E=; b=uBcZ0F0hYr7QhXchTCoChWsou9LrkqpdL9ce6npz2ecC7VarTsF0x7+u+i2lUJqbqZ vCJWURli/u+Lc1UNqXzMw4AseMHNbAdIATjPO1e7dd5ubbKlt4jg7NCjilJZe2/FX2w2 /IZCwybt7ylqJws3L6w4ZNWpXeNg++/geCReusjw6yOBcTpjflTRdiI1uN+dDzIAxL3h iP2PMpIufEmCqkC2/JPpNgfW+nsdROQq6JqzZ0PfDDYcv5EiZcs4SxJErAB3JH7zTMC4 2KvoCKA+n46xRHh4a+qJphQcdVEnzSR4grZ7haJzaxishG6E8iDp3bOn/2p8UcX0kvvH 37hw== X-Gm-Message-State: AO0yUKWdwhcttHDQyKdRfSPiFPQVrM+Gvu8CYTUhm/thEzgJcNE68/5B VeuyIP3qll3dMKpFoEOSBKorHTIWi7OZiHur X-Received: by 2002:a05:600c:4d93:b0:3dc:57e8:1d2f with SMTP id v19-20020a05600c4d9300b003dc57e81d2fmr2331503wmp.9.1676477835546; Wed, 15 Feb 2023 08:17:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r4-20020a05600c35c400b003df245cd853sm2718598wmq.44.2023.02.15.08.17.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Aurelien Jarno Subject: [PATCH v2 06/18] hw/isa/piix4: Wire PIIX4 IDE ouput IRQs to ISA bus IRQs 14/15 Date: Wed, 15 Feb 2023 17:16:29 +0100 Message-Id: <20230215161641.32663-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org piix4_realize() initialized an array of 16 ISA IRQs in PIIX4State::isa[], use it to wire the IDE output IRQs. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index de60ceef73..94e5dc7825 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -229,6 +229,8 @@ static void piix4_realize(PCIDevice *dev, Error **errp) /* IDE */ qdev_prop_set_int32(DEVICE(&s->ide), "addr", dev->devfn + 1); + qdev_connect_gpio_out_named(DEVICE(&s->ide), "ide-irq", 0, s->isa[14]); + qdev_connect_gpio_out_named(DEVICE(&s->ide), "ide-irq", 1, s->isa[15]); if (!qdev_realize(DEVICE(&s->ide), BUS(pci_bus), errp)) { return; } From patchwork Wed Feb 15 16:16:30 2023 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: 653719 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431870wrr; Wed, 15 Feb 2023 08:19:31 -0800 (PST) X-Google-Smtp-Source: AK7set/MNXb/TjXYpLtHPJHeP1iz5ZkwkLJXG4/j0HF+egQlOgzOVCEZS+Km4bmKGxw8o/+QncoY X-Received: by 2002:a05:622a:174d:b0:3ab:a047:58ee with SMTP id l13-20020a05622a174d00b003aba04758eemr4376924qtk.25.1676477971576; Wed, 15 Feb 2023 08:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477971; cv=none; d=google.com; s=arc-20160816; b=rpWUpSnrt/TfSVz72teZWyqUIkUxiIxrwUqwHUbqNoxmaCJ/9bH7u9aIqyqXJwmfBG 8xP5dM0g54yYCMiXKdp2+Xvw2P15MmeqWkKY+LGXzUcu7Ori/sK66CmbBP+Tg7oJdidO uhGJRn9IhHhhtkoe+Sr34x+jRmmQ3wIOMSFHdFCaBqLmhJMgdQDHxAEorK3Rxb8/kcS1 TitRhviGoo2UYTss+KNVn/bLxja/ZSBi6VTQ0pKMZnP/gOiki395INZvWF9R3IRg2lg+ h51QEaliUX29709VDGt57s7eGGjZB29LGx+70q8CYrTOBGzqm+t5WVC3DmpvwJilFgIk mC5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f+MRzlgMTMYiJqY66hAEGi+hsN4wxcZCLS9p/s8Kgnk=; b=hXoq2q9xymFP4xaRNWF2HboZtydw6z+vuCgai9i+NiyOSc4CqXB8Ib/Gkp2YAVRqSF t4SaajDNrHq3CiF9rWt8Di3OAMu6ckns++JhrkhCrmp5G1YU377sou37bNMPXi8n9/95 a2IqluMQ6st8qAsvcPLJHWWXgYjkytd9TMZCfE5eFO/Iw18vI+YSspq8ZVAF4iro9T5R nEhvCskjd3GOnBQe2X/p4v81nM8ThIjXalU55UrVjgwaBVJOXGa3qtwSMEOB+2Nc8C4n 66ZaxDL7aAkDezvCr9dcKZjeu1Go+NBhAm0/JPjuf/vdxXNW3Ll3YEdjpbYWMTS9Tbw1 Wz8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lQ0Tevdy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d128-20020a37b486000000b00739110e814fsi10510033qkf.230.2023.02.15.08.19.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lQ0Tevdy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTN-0007Ii-OC; Wed, 15 Feb 2023 11:17:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTE-00077B-I2 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:24 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTC-0008Ix-O0 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:24 -0500 Received: by mail-wm1-x32c.google.com with SMTP id n33so7711633wms.0 for ; Wed, 15 Feb 2023 08:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f+MRzlgMTMYiJqY66hAEGi+hsN4wxcZCLS9p/s8Kgnk=; b=lQ0TevdyNpGY7dF7OyzGHWKmSz2e9VoC1iIqBRkWJraIgHiSymXC+ZSJn34EkoZb28 lBqpUcFfuON5XDuPEXTPIX3Dj/DDrZNJ2qEmpMGB7UGC23SiC8sd6gVl4Jqig37K/+0m sS/oklWytHV9s+q/utA5h468kOwBAmuSL5Dh8uBkpj1RNI+oPIup/FDZBhF4GG6gRRCs GY4FISPBEwPDpyhK6YJtvmi+8IYOXaIr+POujiD24HuEZ5yDUyU425A7qMrIeCgoarL4 BsZlG92uqji5l4iAd0bccsWrGlS0U8YgbZXYCZa0Jwxx4MxF6nc72XnBE1zIwyV2o3Bd qzvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f+MRzlgMTMYiJqY66hAEGi+hsN4wxcZCLS9p/s8Kgnk=; b=xDoyBfTm93kddAosbLrriQtjrMbXN+ivohi4Rquc4mk8OeFvRieCPwKGnnbGMKOMJP OQCIk+YOB3hw2HG/55vO3yVcb925ZqOFKMyz5P0DksWblL+ENmIaEoeOdteQamFj/9H/ /TaIQpkE5IElypHnZ8b841IQkjQkbBtjS4HllMlfrnizG2YbsZ1komZhQtGOUO34MZBf IOyE+2MoMhJ+kLYXASSkALIfnSUQwsbPQmk9z6VWuDKg64T0kmauHz/ZoxyZ6uq5Rj/j DnRJf1bPrge8cvR8oy/R/82vucJuK1US9XO4dXTTBd/CI0StVW9s5+pNa7nMt7yYPz6M aguw== X-Gm-Message-State: AO0yUKUCZ1H05orDAdYby1jiqdEXVgoig6TgORrr5ZCmaIxprATW8Ao8 bFrqU1guKUzkpTsRGWTJ+LG54wKj6L3INMj6 X-Received: by 2002:a05:600c:4918:b0:3dc:d5c:76d9 with SMTP id f24-20020a05600c491800b003dc0d5c76d9mr2340410wmp.0.1676477841035; Wed, 15 Feb 2023 08:17:21 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r18-20020a05600c459200b003dc4baaedd3sm2862852wmo.37.2023.02.15.08.17.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization Date: Wed, 15 Feb 2023 17:16:30 +0100 Message-Id: <20230215161641.32663-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Ensure both IDE output IRQ lines are wired. We can remove the last use of isa_get_irq(NULL). Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 9d876dd4a7..b75a4ddcca 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -133,14 +133,17 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) static const struct { int iobase; int iobase2; - int isairq; } port_info[] = { - {0x1f0, 0x3f6, 14}, - {0x170, 0x376, 15}, + {0x1f0, 0x3f6}, + {0x170, 0x376}, }; int ret; - qemu_irq irq_out = d->irq[i] ? : isa_get_irq(NULL, port_info[i].isairq); + if (!d->irq[i]) { + error_setg(errp, "output IDE IRQ %u not connected", i); + return false; + } + ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, port_info[i].iobase2); @@ -149,7 +152,7 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) object_get_typename(OBJECT(d)), i); return false; } - ide_bus_init_output_irq(&d->bus[i], irq_out); + ide_bus_init_output_irq(&d->bus[i], d->irq[i]); bmdma_init(&d->bus[i], &d->bmdma[i], d); d->bmdma[i].bus = &d->bus[i]; From patchwork Wed Feb 15 16:16:31 2023 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: 653721 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432066wrr; Wed, 15 Feb 2023 08:19:55 -0800 (PST) X-Google-Smtp-Source: AK7set/8zHvhJzWu8TeXpg1nyCJINv/erQCxOQyBBL+vAUQdoszZtUhtjVs4xpJZPOvoFKfKX0YT X-Received: by 2002:a05:6214:e67:b0:56e:b1d2:9c2a with SMTP id jz7-20020a0562140e6700b0056eb1d29c2amr4604960qvb.28.1676477995455; Wed, 15 Feb 2023 08:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477995; cv=none; d=google.com; s=arc-20160816; b=GFJ1pk+riQacQ6fqsfSstA6J14sDcOlehEWF866ERxvkxQqG+Qe4IfrHClQ1P5kqp6 YmIgbrOAMwovSOHtPMtkR5l9uFuI6pIG5+m+WHNb7XrJHj+89vo97o98YBEa1Yq72Eo9 BLy1bKrBMOlEWOAJIORIelWwE0alkMpNU4j/slDK+hSb/4jOsYEbOUYO3iXlLcVCxWd9 Zu+Xp5UUKU3zPcEO/5UWDCai6Po5p7q+d8Ipx30XKEYAFmgJfjGYCUzhSNspnc09L+Jr k6jMsRZc/lGYiuTSw9PUByfbJpK4Ixo/wPbRXwfR7TRARS6OEJJkUcbnyMR72TRJ6nrK P5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=N1EIfkClSjaM3zvqOesphbcfRGV0aFPgoFdauJ2lJrchfsizltbcasHVqEnXkEEB0D ICn1gNJbHLgV4pFL2py8dqUF5orvTi5AeXl7Zpb3fm67X5Iwy5mJtfoVrS9k/RaP6tLZ CoQVExAXWrJgqRLb8HC5TkBAY394aN2w5gpwlj5zdVo7y074MLxdgXgZ/5wo+gi47UuA Ztdb3Dberfg5YDyb+oH3DRuNxzhfOdz2I6M3f/h0eC2NaegQq+gHb5CE/X6786h0OGZw zRHqRpiwv+MGmOh2Or5QXL9O5jd5rohUTlxn0is5VklQ4CXG27uvlaaiDHVAE10bGlSo 0cUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkvuG9tJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e21-20020a0cb455000000b0053b81ec39f4si13570881qvf.462.2023.02.15.08.19.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkvuG9tJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTO-0007Mj-KO; Wed, 15 Feb 2023 11:17:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTI-0007Ie-Tv for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:33 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTH-0008Fs-7b for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:28 -0500 Received: by mail-wm1-x333.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so1936919wmb.2 for ; Wed, 15 Feb 2023 08:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=lkvuG9tJZarHsGLOIK0ZpVka/xEWqAXIQs3/LUaVxFFISGzwXxqcUa2owhDwsua0lS 3dUXMHdFk/yIew8jNZQDsuPTqkiPl6p9ATS2N4qOWLU+YmngA3jRokcUWe+PeEKoP+oa sdo+Eleisgvi4OVqoApnxNzqlQh4M145qyXENYanQ9+Atk6ahDI/N5j42f8B5RABa2eJ l1Y6EM/caxnVrJ6CMSWI3TND4lrJHA7n+8yyjHXCW/V0QlBYpNCaw41ZQxctmVnhNbgk icdyZTfpMldW+kkUCti9g/H4wFDy3qCGEUgsW+UkR3jnEO6O1FmUd2IWHh2xeVQ6MGF8 sPsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=4zi3nYH6ngCu6cKpsV4SN1M5LtNsV7huenoIvFUbmbzHJa1Zv5dOY3qlLwsL4fMJfC 1IeyeM3I3i3oyHfd4ySpt5KWj3JcADRa87TTLDt827G6d36WEaQ/7fc1ns9dPYAqjCvF DrAXM1YOoH5pnYQT8y0hp0gMnY95HBlZaKq54w4GjlsyM1T6tqeWzF5jn52AwCwGDwes G8AkjX8/pXDl9ftAy9w6I7jlRvEID4oSCzhEh/HOMHqVCUnnhEPCGDJ/+pTup0PxmkLT 1CY4BqPSxS1K3m5Lf3/3/kPeUkwsfS1OoIVt+Z+whgR5dc++2CVHtpY0+Bv76GeSKdAN V8hg== X-Gm-Message-State: AO0yUKVHWO09Eqfg8fS/Wz7qCiESYmvMkRWU6bjU1LjbhGcTY5bj2UeU oH3cUcoxyVN32GQY1nb3iW9cJsNKpVmw7N1F X-Received: by 2002:a05:600c:4e54:b0:3df:9858:c03c with SMTP id e20-20020a05600c4e5400b003df9858c03cmr3550017wmq.17.1676477846330; Wed, 15 Feb 2023 08:17:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d16-20020a5d5390000000b002c4008f0daasm16061419wrv.107.2023.02.15.08.17.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq() Date: Wed, 15 Feb 2023 17:16:31 +0100 Message-Id: <20230215161641.32663-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Last commit removed the last use of isa_get_irq(NULL). Add an assertion to ensure we won't use that hack again. Deprecate in favor of the BUS API: isa_bus_get_irq(). Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 6 +++--- include/hw/isa/isa.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 96bfee9aa7..a9b94e6c8a 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -85,10 +85,10 @@ qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum) * This function is only for special cases such as the 'ferr', and * temporary use for normal devices until they are converted to qdev. */ -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum) { - assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); - return isa_bus_get_irq(isabus, isairq); + assert(dev); + return isa_bus_get_irq(ISA_BUS(qdev_get_parent_bus(DEVICE(dev))), irqnum); } void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 42d36b21a3..1084d68ead 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -74,7 +74,6 @@ struct ISADevice { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space, MemoryRegion *address_space_io, Error **errp); void isa_bus_irqs(ISABus *bus, qemu_irq *irqs); -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_bus_get_dma(ISABus *bus, int nchan); @@ -95,6 +94,9 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name); ISADevice *isa_vga_init(ISABus *bus); +/* isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */ +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum); + /** * isa_register_ioport: Install an I/O port region on the ISA bus. * From patchwork Wed Feb 15 16:16:32 2023 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: 653714 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431302wrr; Wed, 15 Feb 2023 08:18:24 -0800 (PST) X-Google-Smtp-Source: AK7set9/wh0GYRANHfoN9aXTaKM2rDw6ewlz+n1nx83bpqenGjQFzIzLPyRYqavWcWgqqT8awaLO X-Received: by 2002:ac8:5b0e:0:b0:3b8:26a7:d608 with SMTP id m14-20020ac85b0e000000b003b826a7d608mr4596945qtw.19.1676477904232; Wed, 15 Feb 2023 08:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477904; cv=none; d=google.com; s=arc-20160816; b=s0bmbOFNC1bQV4yS200LNreVB7eFnj7Bkj7oRxwzsP+P4FPIOkhiMSGmInre/yWANF AzJOqnP1ZFe8uuK5lNRVP7c25ZB5xf8L/3NdUYAmNeo8Aa/56BMsoKwcchuy2jgnkmBR BNIxAjNVPUeJzzz0dRjTw/2AIiJ0l01SVtKgepqRswmZyBvwakQu9eOj31mFLVGup4r/ rTkZQ+BtQRZxeObAncRTVwU52W4kCSR0vs5O8wG64ABLcDgmoT2GISKrSsI5yHZIFZfI 3oHNVKZabCUW8uf5FO8SjceQE+a5KwBGpiaqjFikD0xDuFaCXont++X1lQlmW1Mj2oVI 6DkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uFnjzOUK6OjqNgjA5FyAgu+o5jYnh8yg7SkXzfxTC58=; b=G/wGuiFeFu3aj+jM4FfM6Zy/u9+ky5OOHqwJK8S4TKJPm+RdDRR8Gw0B737oppvamp 8YccLo0p8QorFih3uUzmTW0fDEb0Ss7XzyIBVQw5LbYHY+VDThmUI6ih15JfGUsLOHbc Uq8nbQglAe9BQZ1+ILCp71BX0gjW7bAXt0wZQrCyxSQbk4PGEtpTZpncHDxmYuIQAnfe OM3w3Hv9XDUKHGfjAPXX8zrJ5qSxsboYiI/yP8t2d+v9WpoBRFcI80DdqSdMuG0a1yML mJE/JWu/BXoeM868SNR+PbU9DkUNaf9hGFOe3KD1KFk6bzCFvC25wJnegcps4WiRqaOg Pshg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNFT3I59; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dm39-20020a05620a1d6700b00719fa0dc8e7si13402363qkb.64.2023.02.15.08.18.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:18:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNFT3I59; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTQ-0007TO-K2; Wed, 15 Feb 2023 11:17:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTO-0007NI-S4 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:34 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTN-0008H3-5v for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:34 -0500 Received: by mail-wm1-x333.google.com with SMTP id o36so13740461wms.1 for ; Wed, 15 Feb 2023 08:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uFnjzOUK6OjqNgjA5FyAgu+o5jYnh8yg7SkXzfxTC58=; b=sNFT3I59hlFB8MN7afM7n/Y4v0SFYR8t2NfIDgIvgI/WR9IBS0pHH1tw9EQ2r91X9f SU9xj7BaTR0JJaYbK+ZVY/LJt9QT3s9zzwkAT8Zp64MpEACBbjEdIPyaDi1fFqMaxsmW hIu7CFTlvfQZphT7wCNOjmbaUN4/cVbfsLSBZisU6TJMoBdXXGuwUNVeW2m+hdnxgIqV D4EmOKAFu5oBR7LOKN+75nFr3iP9azIuRrYfXEsJeWOVjbzXRxqVxziqqXAYFK7gVTSu sIBUFl1TaVvyY2+i6EgBhyFvRO67MZWJMn11hJMLH72Tv4ctImWfCLZU/d2OnmO3Rmgk cLdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uFnjzOUK6OjqNgjA5FyAgu+o5jYnh8yg7SkXzfxTC58=; b=FRrZkNgJjYCoR76HmQXHMRwGU8jh5qPQHk7Gf/y/o5N18ZJREaeYJZNJJ67ZEFI+Gf O8tURGO2TVy6kaJZaJquxprxIqlAZ0YBG2Z7nu+MG8Xfl88nwjvBJL/fQqSC85SJrcKM M8AF9ro/DlATqE/dRWcImHw0rMK9R00XZY2a9UYxyTIRRZw43eBgL28v6Kab/gaWgsBa k4AyPAxBD575qay+CCog2PXU0Td/iRg+hJHavrxCKSnAp0wSib9co4fKP7SqXtqQ4u2s FZjy0eHcC91kTZB86jmKi5DIRDULU6fxP9hiY72ourdydEAAyrzdR5Bx0AlygtCpMgXY weeA== X-Gm-Message-State: AO0yUKUOp1NZNyt9cbBpKakIe0V+SAj63+meFOBFHZzyLD9Qb7nxGw2C J8j4j9+DFkm989g4H0YyRSwIoX5hUyKNDUR7 X-Received: by 2002:a05:600c:2ed2:b0:3df:eda1:43b9 with SMTP id q18-20020a05600c2ed200b003dfeda143b9mr2610069wmn.4.1676477852118; Wed, 15 Feb 2023 08:17:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l9-20020a05600c4f0900b003dff870ce0esm2965094wmq.2.2023.02.15.08.17.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io]() Date: Wed, 15 Feb 2023 17:16:32 +0100 Message-Id: <20230215161641.32663-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We don't have any caller passing a NULL device argument, so we can simplify, avoiding to access the global 'isabus'. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index a9b94e6c8a..08c84704e9 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -247,20 +247,14 @@ static char *isabus_get_fw_dev_path(DeviceState *dev) MemoryRegion *isa_address_space(ISADevice *dev) { - if (dev) { - return isa_bus_from_device(dev)->address_space; - } - - return isabus->address_space; + assert(dev); + return isa_bus_from_device(dev)->address_space; } MemoryRegion *isa_address_space_io(ISADevice *dev) { - if (dev) { - return isa_bus_from_device(dev)->address_space_io; - } - - return isabus->address_space_io; + assert(dev); + return isa_bus_from_device(dev)->address_space_io; } type_init(isabus_register_types) From patchwork Wed Feb 15 16:16:33 2023 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: 653715 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431541wrr; Wed, 15 Feb 2023 08:18:52 -0800 (PST) X-Google-Smtp-Source: AK7set/nuPzT/pMuYMLjTQg3xWH3sdkN5Hde3tRqmiBbukpu4s2UFKsEuGB7wTEG9GraXAwmVGkE X-Received: by 2002:ac8:5989:0:b0:3b8:4694:b728 with SMTP id e9-20020ac85989000000b003b84694b728mr4737520qte.1.1676477932091; Wed, 15 Feb 2023 08:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477932; cv=none; d=google.com; s=arc-20160816; b=e3YG7U9xCYHKQfX/xUgsXxO/1iUd7n3FwdBS8NEd6fvZNIhA4EYL2M8ZwSCk94IekI c0BUUXhm12tI+Gv994EHU8goaFU3n8hdNoZkJsXowZZP3OI/UQ8hICp18KSmcphOCJOo WtU8Gb2xTBSyPMuYxM1kZlcsQ1f/4g6Km/fBbNVwPt793j3J+3q3t88lYjs9EdUtyWyk tv1ILnlerIPDC//tdx8ThoZkthegI3+xNQNRCNofx3ckdftyhxr/ZKT3e6VH8m6b8jiL 3p5LQCOz9dlivNXMAW4xofqFvOiEn64SBhe2QdVixtrbDYCiELPaiNCfvpIPA0CrWry+ fRZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qyUIbhj07XcqpScbyTudufNTnv88vdyZCLw8YDqH+8E=; b=ALcgnCQP59YY1N5+jlGAIN4yUKXMh3Zzj5ZWMhNnPsOIY8zcnr9XXLdLq89cUBJP3o r47yH4i05JcPg81aTvSmDNcdO6imubvHvVKddATKLZnvCMx+bqUzZbU1paDSRjiB1K6P BoY9PwIDQG/MFbOEP/orUECv0BVf8OoLX+fP6S06WIoNT4wNlEO7B/KZveSZrXu1GXY+ 7Mw/lOMIeHfHbJYW/6+95rQqKNRcKNRRi+Ljorj4JigCpdWHkJdFiWMJPqlS0/Kj1jxw oRuDEi0Qz0x1GDgS2MIgHZboOihDmqVly5MjweXEieVzc4+bh1MRoA+WzsDcH/LoGepw 47FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nsqUb68D; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c17-20020ac87dd1000000b003ba23d469e6si13677376qte.159.2023.02.15.08.18.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:18:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nsqUb68D; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTp-0008BS-F8; Wed, 15 Feb 2023 11:18:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTX-0007jA-12 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:48 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTU-0008M1-8i for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:42 -0500 Received: by mail-wr1-x429.google.com with SMTP id bk16so19693676wrb.11 for ; Wed, 15 Feb 2023 08:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qyUIbhj07XcqpScbyTudufNTnv88vdyZCLw8YDqH+8E=; b=nsqUb68DWzG9WtJIDlG+QYVcDwW9BfHBnHpfGqubntklmaZsK0yWeAod+Kr74rxskb FhLptyYI0XsEUWw80rYT/B+X6Iwr7rESCjntdThZeWAZaie70mSRQ8z50z7Kz+mNYw5+ Gna9yWQrwxFZmRJdXv7Ek5XCJnnzwBg2YlZy2g0f1WofAZuMf6oMiwMdg00KJToctIC0 zod+PzTxxBm0hXEIdvgEiEKvz2O45WhDZtI/GshzdvI62q/2StrTyIPZFQ/4lMK+tjNa UytLpKJxjHE+a0gV7/m14rSYVjavVHyA930XlQq7pF9s9rc/87HzueVtHMtTJQOwuw/f 6wRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qyUIbhj07XcqpScbyTudufNTnv88vdyZCLw8YDqH+8E=; b=4goy79/0viTxys506PH1cSPWwuVjD/4qA46m6+4ieQkHDR6fZ6b+CFTzlIBSpiLU5r 2fo6y63VwZ/U4v6rZdKe4qo49WmEyYDK0eR+Tmvas26YZedn96ryyygxwND3MmMOEzLw MHMgUOVZupgoq+cfwUtrcK8KuwFh3RJYIAdYrrJL0XJTk2v6nWOxj8n4R12w60C2NCnk 1k8Dg+KQAElkbKiYMihZy5pP8nUHahV3VB1f/NyCSAumL6wPa9aZGQlng2+sCTFTAmwe rmxl1s+CgHNZxTtuDcy0xky8i61j8qxzrCbBu8wiR/FO4aWQD7CVAyE3Tl99tVNdXzPf PZag== X-Gm-Message-State: AO0yUKXih3c0bYOo9g35IdJG5g+8QjSDAr06Fhhf/Q+xxaw27TlG1pMI ptOKsee/PBaF/wEd144YKwm+gc90lmq+IUOt X-Received: by 2002:adf:fa4d:0:b0:2c5:4ffa:ba62 with SMTP id y13-20020adffa4d000000b002c54ffaba62mr1985092wrr.17.1676477858167; Wed, 15 Feb 2023 08:17:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d1-20020adff841000000b002c5640f9bf9sm4660663wrq.85.2023.02.15.08.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 10/18] hw/isa: Use isa_address_space_io() in isa_register_ioport() Date: Wed, 15 Feb 2023 17:16:33 +0100 Message-Id: <20230215161641.32663-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We don't have any caller passing a NULL device argument, so we can simplify, avoiding to access the global 'isabus'. (Since the previous commit, isa_address_space_io() assert the device argument is not NULL). Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 08c84704e9..abc1bd0771 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -120,7 +120,7 @@ static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start) { - memory_region_add_subregion(isabus->address_space_io, start, io); + memory_region_add_subregion(isa_address_space_io(dev), start, io); isa_init_ioport(dev, start); } From patchwork Wed Feb 15 16:16:34 2023 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: 653723 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432402wrr; Wed, 15 Feb 2023 08:20:39 -0800 (PST) X-Google-Smtp-Source: AK7set8BRl7GMDd8PhM4iP2Ug85t5KurYkXqco5A/IItyORCsX/ns2Ui2tzKKqOGcU7wci47fvaV X-Received: by 2002:ac8:7dc1:0:b0:3b9:d14c:39f8 with SMTP id c1-20020ac87dc1000000b003b9d14c39f8mr4506345qte.40.1676478039644; Wed, 15 Feb 2023 08:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478039; cv=none; d=google.com; s=arc-20160816; b=q/NF3AX4gzKLQvjuMH2ymmOYUKQHnj74HEyBa9qziWdCaFZiA38ZEDv+EOnEGrSEMd LzSw/skZnxcemwmoexsJuCxqBTrg14qPiV7sTt9p7ZkRiXKboERZpIOeax+zdiTK2mC+ EwrMswfBYA3OWfPBeHKFKP/Ryy1CwIfzE6EcB9QIbMi/jzXqDukTACWcWqxCrew/uBMo 7PAsZ4QnB1UW+dompmTGrOCtORMUmnwkGMuibPjw10ynkAC2dZg5eVhiVaEcanBgPogi nTfom5CFXof339CkoxlmrxkLFbikk+GTqyWcZHEIV1He9x7MZ3FlYM2Y7Tj9CpiZcNlo dPsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l+kQmnueqHR1/7y+7KCNnDEw+Oe5smCTiQ+KK+3S1XU=; b=bhM4E5QUli4+sBvx6sNSVvtvY3MTWyPqObZE06Ka6gnhy7ubFKjnIZEmKpHrn/7e88 m7HAN2rot2bCCcDoIRzpOShCW9Hf3lE9O5ikO8omT5KgjEQLZZJeg5JL53cbM+d9S3XB NXGsgkUY9xIW4YDchlV/PZGwCJH63lBo+M9exQppxgLBtt8S1iPbMuZcVfng0+5gnuIq EOr/gM4iBQUIb521DrrFYztQG2uxxuCY4yzjst2gO3sISUzNywsjfW2mKNpVdioh0LqG TOKF1DtQQmk5uHOSr4rkYDFSrdz74rHprEs2DckHejIIYMQqtzIqsMy36IYuBaURdPqF b6vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m54RaJbu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m16-20020a05622a119000b003b9ea8e8163si14991212qtk.731.2023.02.15.08.20.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m54RaJbu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUZ-0000nI-84; Wed, 15 Feb 2023 11:18:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTg-0007vY-Gz for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:58 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTd-0008Ly-Ah for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:50 -0500 Received: by mail-wr1-x42d.google.com with SMTP id o15so16400609wrc.9 for ; Wed, 15 Feb 2023 08:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l+kQmnueqHR1/7y+7KCNnDEw+Oe5smCTiQ+KK+3S1XU=; b=m54RaJbuwcvSdYapRsachmMl8LykgQH26lhBCZefJKGLimV2/KqoE9gATdeYKqV/2J 0CIQ2dmH/qCV5B1KrmGhz5KLKMkeffT4P5zDBvo6+cRuLQQgNasamOjp20X2YK7koei7 ERN8kMcssrRGlPlBKeRZH9ZbNU1m5+O6ARvx1kUVKn4jSCUYyzDtGNP37ioAsZhTt2IW a9izcyJw0zF5frfkVsN5vA79IaYB4Er4F7H+MvsH3t09FAMHCn+hsIu8D3L7D+E+NCXf fecqV+CKwdpIDbRh5Uo8d0d+oKOi7CILk++8vID41wzvQ5reHKdy96JXgET/5aduxyzT XtjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l+kQmnueqHR1/7y+7KCNnDEw+Oe5smCTiQ+KK+3S1XU=; b=n8IJcs7DRWcYBqAG8YShLBaACZ3sb42a6A3YDU+iddxwPOzmsb6kdp9jngoogWobaD GE9Ahi0uAeg7Og9DZ3seHClhIws1bW7PqVQgzZYRiPh+W3IWhQ27AXFDRZsobnwrM65E AD6Bue+8XjaRmfkNuQjE3RqYpVG6X3kz7eHJ4lj8DdAUEya69ADxcvvv1vDZU3h3FzCk ETQhamI0aaoZ8JvPPb6B1G0io0XOkB7qHyr7LGbgrJDegXbtpWL8Y4JUJtgbEZ6dKD1S 74c5wFs/bPIsganYYhIgJPx5K73FLFcwwYJIVrXhJ4Occ8aoC676ruSHQ5eU4OJ5MXIH xfSg== X-Gm-Message-State: AO0yUKWJpscvhPRgfDuIkCWNqqAHdu5KLCABgIPDOlhKl0Az4pxiwUAS 9T84Xrdit/ihN8Mj7GTq1pX395M7ObELB98X X-Received: by 2002:a5d:4cca:0:b0:2c5:5258:b6c with SMTP id c10-20020a5d4cca000000b002c552580b6cmr1963532wrt.68.1676477863705; Wed, 15 Feb 2023 08:17:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y9-20020adfee09000000b002c550eb062fsm10941044wrn.14.2023.02.15.08.17.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Marcel Apfelbaum Subject: [PATCH v2 11/18] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h' Date: Wed, 15 Feb 2023 17:16:34 +0100 Message-Id: <20230215161641.32663-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ide_get_geometry() and ide_get_bios_chs_trans() are only used by the TYPE_PC_MACHINE. "hw/ide.h" is a mixed bag of lost IDE declarations. In order to remove this (almost) pointless header soon, move these declarations to "hw/ide/internal.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 3 ++- include/hw/ide.h | 4 ---- include/hw/ide/internal.h | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6e592bd969..79297a6ecd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -34,7 +34,8 @@ #include "hw/i386/vmport.h" #include "sysemu/cpus.h" #include "hw/block/fdc.h" -#include "hw/ide.h" +#include "hw/ide/internal.h" +#include "hw/ide/isa.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci-bridge/pci_expander_bridge.h" diff --git a/include/hw/ide.h b/include/hw/ide.h index 24a7aa2925..db963bdb77 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -3,10 +3,6 @@ #include "exec/memory.h" -int ide_get_geometry(BusState *bus, int unit, - int16_t *cyls, int8_t *heads, int8_t *secs); -int ide_get_bios_chs_trans(BusState *bus, int unit); - /* ide/core.c */ void ide_drive_get(DriveInfo **hd, int max_bus); diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index c2b794150f..d9f1f77dd5 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -647,6 +647,10 @@ void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev, int bus_id, int max_units); IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive); +int ide_get_geometry(BusState *bus, int unit, + int16_t *cyls, int8_t *heads, int8_t *secs); +int ide_get_bios_chs_trans(BusState *bus, int unit); + int ide_handle_rw_error(IDEState *s, int error, int op); #endif /* HW_IDE_INTERNAL_H */ From patchwork Wed Feb 15 16:16:35 2023 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: 653726 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432523wrr; Wed, 15 Feb 2023 08:20:50 -0800 (PST) X-Google-Smtp-Source: AK7set+nA+h4LcKKElaTbVNWM3jp/T7j+z8bCS0gIj2i5DgrJk0fFCfEz2ckMQSvheWFkSQJ7HIY X-Received: by 2002:a05:622a:203:b0:3b8:5199:f84a with SMTP id b3-20020a05622a020300b003b85199f84amr4104644qtx.3.1676478050162; Wed, 15 Feb 2023 08:20:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478050; cv=none; d=google.com; s=arc-20160816; b=zTBdPmjYzI+wN5t6p2vrDeUIR7KnJJdl84G2vlDtvxKOy2ewVDcuwKkJcsuqyGhKyg h+5O8JY7UQLbLCc5fCNF1ORlo8Ief14andet2BjS9+qqDfmf7eLWJABnt/55lOgfJkmz xkQaVBLcdBRmAKZgJ/93nLmRnDTdIBGRJ3AWPoJYRuGymIunjZTozw1YuiylrRbsNv2h qHRx01C7/cX5yB0ZjROt+hl30WUrIXeenFuqwjAoiEiceZb0BoYmGxH1a2sobbCz/cgk FwLxr2monhTkwqg6akNEVrdvGEVZFfx55rHAQykTrbPfIe7noxJwJzKO7UfrlC/i3NUM Owag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8g1fN9ZadBbCVgP43lfSxFkkzaM8dsC3CGvZpofDcyw=; b=xhwirQ0YIV9Cg60PwaFYYq4bUZ7LQS3eEzUXIaAqlgRzmBbu5AYyXZpo3xCqUeThwN wPUNykItvMPi4AtdmT1ZrA3/gitA1ORhTGY8FIuwsuHwFu3sUJCpUTrFDhB2Klja/rLY euUqMcBfDPsex7ES7fiW0VmgIF4lr9TGiiS0NZ6O0pGiCx1MuJWXEbdfPb4Vpc40mEwC /g6m0sfPcwHN9ref0w2hNX3MSxHr8nKtrIegz+HlMVfy8B/M1GroTIXKSAwr7SL+SQ8o EWQMIOcpB4+Lal+xOnrdBNkIBmKAuqXEx/CYc1QoEX7R/jMMBY1tmFz/TPf46njH6qpm JKug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VSdcpfTH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 130-20020a370b88000000b0073b7cc3de5esi946988qkl.328.2023.02.15.08.20.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VSdcpfTH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKU6-0000Bm-B2; Wed, 15 Feb 2023 11:18:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTl-0007vy-3C for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:58 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTe-0008Oe-G8 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:53 -0500 Received: by mail-wm1-x330.google.com with SMTP id j29-20020a05600c1c1d00b003dc52fed235so1944713wms.1 for ; Wed, 15 Feb 2023 08:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8g1fN9ZadBbCVgP43lfSxFkkzaM8dsC3CGvZpofDcyw=; b=VSdcpfTHjUzd+NmSrrRpIjIvw6xD/kTm03egoZZ2rfaMbFm5L2P+SW4RgTZRVBwi8F gsDC2bNoPbm/xxq2M9Q8vuwpJWoXtUjbCP9HmzmvUfd4v/c90NBHO1pHMNYk53fV3N6N HYPXP18/Np8+RFhhNf23tMXo/4lpTF40E3Y9g1ziJ7jDfCGjkyYph4C15bL36PKsG4ar ZxaBqivjDTtBsk1XqGgtTnadRTBg6BntNpO7+7PacjzKDYefBnTPkEsuZGbINqBPfYeO 8Bde3ATH87oc1REwzdHtAg8vfROUrT9wWxG4a9F5h1xkIQtBsW1pT+XtZgFMGBhUf20P 0Azw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8g1fN9ZadBbCVgP43lfSxFkkzaM8dsC3CGvZpofDcyw=; b=o4GXWAR6btf0vfI9/xNPe1KJ6glKKoO7aWQhubN6NIZwEhj3Yu+3h0k3Q94X44oehm A6m/bCoLo5N621MlFqyEmdrUObgdwtW7vD9kXiTXGI0q0c8EQA/cJeUPyn7Fk01qKodb p0qO65x5XBi85Dw8UVGXl+saH/Ihu2euXN5C2LgxanjUAw9ahzBb/rmk41dU6g9IX+d9 eWXrA9km7e/EjgXjbtzzqUL6RGEKKIUMYwyzsR5nAmZgvUxkPay+VhGMaVLmfHQ3Ukyd 8k9oeB6+nwQ8O7GePD5XKDA3VoAjvLCNFaJ4JHGTom7QoopxRGxmkbV/Rf18MTmPvoRE EDOA== X-Gm-Message-State: AO0yUKXTQkq5uqmv2BM7QBW/ybGn/paw2d+LLI45CiZe1QqUvjow7IJm v5u+eLGGwOZ/JKRZNqkxtL1+0ym0M/Ll84Ke X-Received: by 2002:a05:600c:997:b0:3dc:5b88:e6dd with SMTP id w23-20020a05600c099700b003dc5b88e6ddmr2388542wmp.10.1676477869102; Wed, 15 Feb 2023 08:17:49 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j2-20020a05600c1c0200b003e204fdb160sm2290594wms.3.2023.02.15.08.17.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 12/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa Date: Wed, 15 Feb 2023 17:16:35 +0100 Message-Id: <20230215161641.32663-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename ide_init_ioport() as ide_bus_init_ioport_isa() to make explicit it expects an ISA device. Move the declaration to "hw/ide/isa.h" where it belongs. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ioport.c | 4 +++- hw/ide/isa.c | 2 +- hw/ide/piix.c | 5 +++-- include/hw/ide/internal.h | 1 - include/hw/ide/isa.h | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index e2ecc6230c..d869f8018a 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "hw/isa/isa.h" +#include "hw/ide/isa.h" #include "hw/ide/internal.h" #include "trace.h" @@ -40,7 +41,8 @@ static const MemoryRegionPortio ide_portio2_list[] = { PORTIO_END_OF_LIST(), }; -int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) +int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, + int iobase, int iobase2) { int ret; diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 95053e026f..6eed16bf87 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -71,7 +71,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **errp) ISAIDEState *s = ISA_IDE(dev); ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2); - ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2); + ide_bus_init_ioport_isa(&s->bus, isadev, s->iobase, s->iobase2); ide_bus_init_output_irq(&s->bus, isa_get_irq(isadev, s->irqnum)); vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s); ide_bus_register_restart_cb(&s->bus); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index b75a4ddcca..9b886fc0d2 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -33,6 +33,7 @@ #include "hw/pci/pci.h" #include "hw/ide/piix.h" #include "hw/ide/pci.h" +#include "hw/ide/isa.h" #include "trace.h" static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size) @@ -145,8 +146,8 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) } ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, - port_info[i].iobase2); + ret = ide_bus_init_ioport_isa(&d->bus[i], NULL, + port_info[i].iobase, port_info[i].iobase2); if (ret) { error_setg_errno(errp, -ret, "Failed to realize %s port %u", object_get_typename(OBJECT(d)), i); diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index d9f1f77dd5..d3b7fdc504 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -618,7 +618,6 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, int chs_trans, Error **errp); void ide_exit(IDEState *s); void ide_bus_init_output_irq(IDEBus *bus, qemu_irq irq_out); -int ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); void ide_bus_set_irq(IDEBus *bus); void ide_bus_register_restart_cb(IDEBus *bus); diff --git a/include/hw/ide/isa.h b/include/hw/ide/isa.h index 1cd0ff1fa6..7f7a850265 100644 --- a/include/hw/ide/isa.h +++ b/include/hw/ide/isa.h @@ -10,11 +10,14 @@ #define HW_IDE_ISA_H #include "qom/object.h" +#include "hw/ide/internal.h" #define TYPE_ISA_IDE "isa-ide" OBJECT_DECLARE_SIMPLE_TYPE(ISAIDEState, ISA_IDE) ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int irqnum, DriveInfo *hd0, DriveInfo *hd1); +int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *isa, + int iobase, int iobase2); #endif From patchwork Wed Feb 15 16:16:36 2023 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: 653716 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431712wrr; Wed, 15 Feb 2023 08:19:11 -0800 (PST) X-Google-Smtp-Source: AK7set/NMYb+myHJ1W6LRscaZXTjfWi/svLh6z0Vbjpx8tmz/yvgkRYI+k5a3v+SHv4w6/AlV7f9 X-Received: by 2002:a05:622a:15d5:b0:3ba:13e4:527f with SMTP id d21-20020a05622a15d500b003ba13e4527fmr4551538qty.13.1676477951002; Wed, 15 Feb 2023 08:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477950; cv=none; d=google.com; s=arc-20160816; b=RUJA9yZVzmQ6h9dbC5GMIvJOdw+OEvA96ro8fVIlHicP6DHKCv3pxZgtO1M5iebTwW tjDUfIgt0tHvQQKnp/RgSRutyWBOKP9O2LFTYMI3ZiTPAjmPJ//qDeW34liRkooutSiW +65qzsaE+kxryjLkHD6AEgiUwjIkXw0rIcLZdJ2Yxbi58dvVeQvt8k9kYRLqFWUCHORE 1uTUbA9bXEsmkPgC2j5QAGOfF1zt5g25AF6CSelf2Rr4PIJFqD5CAOqOQ8aT+r8RNTNs 91xau2ikOX3j2n7X1V+gI9aeeLFIXMD1ubvgbcbZHfbFVNaunYPRuXu3lGhdrJKNXUs+ Nu7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LaRrQzpsNkq8chPrf481OHT2Dybo/sVF5goX8elaTUo=; b=nAvcMD+DNUX1AeRga5k1M7eX0jiOQLeHMWlvadTDc3PTFjPez9HNB08Bbxt7icdU06 HwFy9OY5onbyiXxzVo65bx6ny1gfJAmhN7+VXwBRTWi+aeuhwXhqNxvSKe9dDhXyHtp8 3DvhuO9Y2RmxIdUYhj2SoXIzPvwOXe+LsAwTsk4A2aO4KoKpkKCBQgCKxnpkMdaGITlh X+jH1iY72P0Af/jSFQ3iVHofC6QGhggCc/klunVV7Xw7yrbgLCBgXi4lw58aC0u1c0HL DezBUuPVb3hzJ//e1eid8kb6TSapsQfewGlE6L18T3UPQd+8EP4eVb/gH9HuQlOfcPcn gy5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gJNplsGC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g3-20020ac87f43000000b003b81b32738dsi13750198qtk.393.2023.02.15.08.19.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gJNplsGC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKU1-00005Z-Ua; Wed, 15 Feb 2023 11:18:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTn-000895-Uo for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:00 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTl-0008Pz-9V for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:59 -0500 Received: by mail-wr1-x42d.google.com with SMTP id r2so19707658wrv.7 for ; Wed, 15 Feb 2023 08:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LaRrQzpsNkq8chPrf481OHT2Dybo/sVF5goX8elaTUo=; b=gJNplsGCi34nC2PeByIpDMB8+tuLAp2G4wxiI3bsCguEMb/czRkttBHvVTkSX0Hk4I yFYzKSrojVj4lP/PQ67R28TntPZj93ZRLsg4F5JU7xhNJAfeqebtfuqnURrsFstOB9QL QeTaoPJYg9FuoQ9M72dGoIhdi6mHTQESUDj2AHwfmqQtXfGi1+T+vqJiCIcHZw9aLRax rVgcsidolO3SU0DDRs/6jPvdtSRZuqSriY19q+W/1e8IYxoVX2QrwKWuQIOEp3L/p+kt Z9OkBELz5verOI4fauLVlpA1QF3s+zA9oXs5COyccSoLpHf6t/uk78WIQP5BbwmYaM+Y ZtPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LaRrQzpsNkq8chPrf481OHT2Dybo/sVF5goX8elaTUo=; b=Px+TzQHDphLw3INW1MmrxTAkIP4xctIRu2sF3So56hcK8y2/6fnnEEa1Y4iSX6naTW YzfQbBEp+on0OpRwCLCAP07eEc/rFIpKEwviXDbJQ8bH/KxciYPo+OfiQztwWCn3bkTN 3Dl2saI3qS2pVdj2yrk9niO2nqrchdLFBQUmNJffR24jxAzouoFuxRTbSAApypqCFLaS h3lnh/KyIdt2XRngu7/RNdt7hX9chb31bdhMttoNrcIfvqvo45GBtL6iBJROqyauFQUe +qCW1asm7i+4J51xxMRNxtPShokFvEcugFG9bgkwHTmPGK1KNq/ELaIpngHBVD/et6/N Ywjg== X-Gm-Message-State: AO0yUKWSfJRzfqXC9PEkkATigjNqnY9Y5G08LhNPicU9ZMoW8YMrfi/j kFxQ2dRHS6RFIujS58kmjjhBd6d4nzjmcOlk X-Received: by 2002:a5d:6aca:0:b0:2c5:588f:84a0 with SMTP id u10-20020a5d6aca000000b002c5588f84a0mr2223236wrw.3.1676477874767; Wed, 15 Feb 2023 08:17:54 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m32-20020a05600c3b2000b003e2066a6339sm1521491wms.5.2023.02.15.08.17.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Mark Cave-Ayland Subject: [PATCH v2 13/18] hw/ide: Introduce generic ide_init_ioport() Date: Wed, 15 Feb 2023 17:16:36 +0100 Message-Id: <20230215161641.32663-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Add ide_init_ioport() which is not restricted to the ISA bus. (Next commit will use it for a PCI device). Inspired-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/ioport.c | 12 ++++++++++-- include/hw/ide/internal.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index d869f8018a..1d4711dd91 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -46,8 +46,6 @@ int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, { int ret; - /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA - bridge has been setup properly to always register with ISA. */ ret = isa_register_portio_list(dev, &bus->portio_list, iobase, ide_portio_list, bus, "ide"); @@ -58,3 +56,13 @@ int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev, return ret; } + +void ide_bus_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2) +{ + portio_list_init(&bus->portio_list, owner, ide_portio_list, bus, "ide"); + portio_list_add(&bus->portio_list, io, iobase); + + portio_list_init(&bus->portio2_list, owner, ide_portio2_list, bus, "ide"); + portio_list_add(&bus->portio2_list, io, iobase2); +} diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index d3b7fdc504..6967ca13e0 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -617,6 +617,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, uint32_t cylinders, uint32_t heads, uint32_t secs, int chs_trans, Error **errp); void ide_exit(IDEState *s); +void ide_bus_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2); void ide_bus_init_output_irq(IDEBus *bus, qemu_irq irq_out); void ide_bus_set_irq(IDEBus *bus); void ide_bus_register_restart_cb(IDEBus *bus); From patchwork Wed Feb 15 16:16:37 2023 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: 653729 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432669wrr; Wed, 15 Feb 2023 08:21:09 -0800 (PST) X-Google-Smtp-Source: AK7set9wFBYMt2oPRZylG23OEXsbsMwfe8R270IlTH9C+vpT0Wi/fLb0NV5bM9yrgsb04ug0VSPl X-Received: by 2002:a05:622a:46:b0:3b8:57a7:7836 with SMTP id y6-20020a05622a004600b003b857a77836mr4364168qtw.46.1676478069529; Wed, 15 Feb 2023 08:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478069; cv=none; d=google.com; s=arc-20160816; b=BOEv0h395R+mFztrKlAns7EGqvkDV2tzmfsI+hFaavj2n+nFdxX2+nuCrNSdNugvhd jRvlbq5OAJSdjlilzqnIi7tDNTYL1sE7bkvZM8MdSCB0bg+vAZL2zTFVcrSSqUaciDUE 1r9yTB4TQiYYWb1ErBU8ttNNaKtprr51pVCH4UKlfW2wKfsg+puv6kkHDy7WiEl99xyq v5M+Js1Edfloglf+cUJvOa8edC7ojcpYV4GI6yJ2XgsBiG32LKpUOhRU2SKQ2WcTzQYX FOIU7QHH3BTa+cmUwOyOe0yeBhzs4rhXiqm0ninEURLshi4B1i3gRJyTephUiN+bk4fd dRRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=I1NqLa0o6CZO3A6UmRafFgBFZMvz17unH6lsoZpuUwsXKXzHRnJjwnLukmC0bl2jIu ygRMMpSRpfIgyUeIBFHbB4xsC/fulsZ4rEBOX9R6OxHMx11ROrUSGv0IqHXtnBoYUeSp HoNIo6EBjpPxzCBasVP5MLDlVQqCFai66nRgDlKm6ktSCQv25TF+IovGmPIdLmhvAtLQ P8bkOqnGwXSHxdTOa+qDEVL6bso7BMd9FjGXATsQFrmKlkFwt39v/oo8VDd1D4L8Ptav 4umSNHKrVyO9CXsPW3jT0vfp4jQCsUXCNcmaI1p1cN+lo6t++xvrwJ56aaqqRRvx7ARy 7qQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZWfBMaGK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n127-20020a37bd85000000b0072b562a287dsi13445919qkf.514.2023.02.15.08.21.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:21:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZWfBMaGK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUZ-0000nf-AT; Wed, 15 Feb 2023 11:18:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTr-0008Pe-Nx for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:04 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTp-0008RW-N5 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:03 -0500 Received: by mail-wm1-x330.google.com with SMTP id r18so13714007wmq.5 for ; Wed, 15 Feb 2023 08:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=ZWfBMaGKpRyCT6OmPutkN7J+5/NIURI+kkldQUfJqa62WBAP9dVOuAwbsT1tPASD+z 7c4pExa5OzJLWoV94ysr0SBoaTT1qDp/RRzPxJ5s9zph80iybfYnTRFfkVVE9Gz9REIa HjHyVhWD8ezjAZI81Kl3tIKNxz1LkpkOxw4PiSi7Ezt2nZuOnRqXnxwBqnBHQPgY3+kI +dXRTUkEAFoMPYZoRSbM9PvSyX0/Q7eHcQkLeqBuL7mKNcF2LiED4PAQILsODOR5i96y +1oozRHjmbe52wxR6RyROXwiCiYPUdq3y176vetRRNKBpuSTtd+gPiXhZcwBZo9tZW/1 3LeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=d7XEB8ef+9C9uiyyLUCF5D/C8JetOhnQGguueRZjS0cq7/gjrIRiFSaHYE3kZIEE0+ uACt05UR1Valy90zDKvC46rZ3ml2ZAnS75X3RaxiXLq6UsSrv3FAc9o42/eCkPgREQT4 i5F2grM4ZHysOknpaLzJFQ5Ado1ubGQHud9HjputQjfMIy/NjL2rS1ry/7zWbqYjh4N7 0cD2KzZgj2gYBvwjUhgMBAL81KHvyAVtHtQ8GvF/m/Lnr2z9VBkdyBvKn5iVdjikJgTt WoaK8tddRoIyY6feMmAHBF6lH9XCtHi2UlcyeSkZIQmlOYZkYcO1fYTgqTOtTpt0xhhh WEnA== X-Gm-Message-State: AO0yUKWAG7gVESV3REN2RvYhD79kWFOcygHDzIdQMPJjvFgdjCqXBpmS avVp3b+UtfGS0q6vveAphJi97q2rTK2ptilj X-Received: by 2002:a05:600c:1819:b0:3e0:10d:f1c with SMTP id n25-20020a05600c181900b003e0010d0f1cmr2392096wmp.37.1676477879933; Wed, 15 Feb 2023 08:17:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t14-20020a1c770e000000b003dfdeb57027sm2379319wmi.38.2023.02.15.08.17.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Bernhard Beschow Subject: [PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport() Date: Wed, 15 Feb 2023 17:16:37 +0100 Message-Id: <20230215161641.32663-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org TYPE_PIIX3_IDE is a PCI function inheriting from QOM TYPE_PCI_DEVICE. To be able to call the ISA specific ide_init_ioport_isa(), we call this function passing a NULL ISADevice argument. Remove this hack by calling the recently added generic ide_init_ioport(), which doesn't expect any ISADevice. Inspired-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 9b886fc0d2..74e2f4288d 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -138,7 +138,6 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) {0x1f0, 0x3f6}, {0x170, 0x376}, }; - int ret; if (!d->irq[i]) { error_setg(errp, "output IDE IRQ %u not connected", i); @@ -146,13 +145,9 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) } ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret = ide_bus_init_ioport_isa(&d->bus[i], NULL, - port_info[i].iobase, port_info[i].iobase2); - if (ret) { - error_setg_errno(errp, -ret, "Failed to realize %s port %u", - object_get_typename(OBJECT(d)), i); - return false; - } + ide_bus_init_ioport(&d->bus[i], OBJECT(d), + pci_address_space_io(PCI_DEVICE(d)), + port_info[i].iobase, port_info[i].iobase2); ide_bus_init_output_irq(&d->bus[i], d->irq[i]); bmdma_init(&d->bus[i], &d->bmdma[i], d); From patchwork Wed Feb 15 16:16:38 2023 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: 653727 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432584wrr; Wed, 15 Feb 2023 08:20:58 -0800 (PST) X-Google-Smtp-Source: AK7set95Uj+ijdWYG+WcpoLz0OUzxX+cic2U7cAWHeHa6WRFk5xENTB2kUMSuzxpw2YmyzKZY220 X-Received: by 2002:a05:622a:1442:b0:3b8:2cf6:4bd6 with SMTP id v2-20020a05622a144200b003b82cf64bd6mr3565381qtx.57.1676478058049; Wed, 15 Feb 2023 08:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478058; cv=none; d=google.com; s=arc-20160816; b=mtS3x+gaysHYmEbs4+gnMRSmR5A4rQf9HdZWLw8eaVX5EeIWema0N87OYO9CqNzIYL TaO4wL54UpGuwEtIodE4VjacpL8hljgmM42gs0XSNV4SHnOM1pMYtR+WS3ZI84p5qWEj i9K+CvBhQVfwtgOpt7vmv/mkmFX0MztXuITpjaGnYgZRDwliWvQp22PaJbIrdoMYzcI9 4xqriz/EKX/8+giVyjI7vp3inkbz19vnxVbJyp/bTNw4BJzTRmR49W+LZ7MdBeLa3eWU /scS87nht7qT32aOeYz5a4ZMHIEjtpuyv0ZwMXnJPXARB3TLiMB+MY+R/jvKEwa/jeZt N2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1RUJxKchPku4NWeByHhp6ftHtPwKBb41iVLhcZRE2cI=; b=dUXMYQRLjqcefAgmZdJHZ9qMi3Vh4/m2kr2FtBLW0bBiZF/7tIZmfOMW4+udopbGPf 1MXk0NNxRxk2OepO2cRbx1CZHnBcepin3gndrjglsn++UoLMcW6Sj7gc02gzQ6/XpVaW luWwxRKk54JZBCEF8oosADJY8cUT0qPwZwfBF7P50LBnsOgVKqAiCHiMRTYAmk3Gryhv 5ZgtsqTeKrs7fGu1aH+CcXFJMCFlmHvbrum8hUVeQ1ikMFJsWj0xpkmOXvm/wjqNtDVu iN26MQfO8uOtp52bHIOlCAx4d2lVTUvhiv9yv9D1/cD0q/zQb5SLwj2D9bWqkUKB7xxB sRfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QLYWuzZQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 15-20020ac8594f000000b003b8df60b674si14741579qtz.244.2023.02.15.08.20.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QLYWuzZQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUd-0001Rh-5s; Wed, 15 Feb 2023 11:18:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKU0-00006F-Ny for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:13 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTx-0008Sn-Uj for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:12 -0500 Received: by mail-wr1-x434.google.com with SMTP id l2so3083963wry.0 for ; Wed, 15 Feb 2023 08:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1RUJxKchPku4NWeByHhp6ftHtPwKBb41iVLhcZRE2cI=; b=QLYWuzZQvLCjzODBlWvwXGOEfDGjL5w5+YmJxblumx2c/bFUCQBxek7p9J84VPKWeh 4K10Y21GcwaYb1wcxIikeGffsdNLdCVOlF3pr96P7l5fEz3cutVrGDeBj5f1FJ8LaJ8+ 5m6na1lMAfpdFVHMXah0QyQ28ZKBtksXyZsD+rTE8TvVrWqw7rKxL/gJg2vOLbsTdYtd DAzUa6yE7JPrJLJYBy60vEdDx9Z8/V0G+exGBG1Hyol+IchPdgGaoH9Hg0qknHs9Ws5T jNBb0zgivNnzYJTZIb9gyLRLu/lMrggLs6//udyroveG7KwgZ4SDOPg0ienCEjji6rce PO5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1RUJxKchPku4NWeByHhp6ftHtPwKBb41iVLhcZRE2cI=; b=jFmFTFOAH2V20wcUnoaROqftRNApfUqmVucS/k7qEtpBcyAyLh69RBpl5ir06Gej4T bMZTtqVU7pygM/OmXckarH7MmxfTQlulJNfRgdJyAREYR0uBD9THASt0R0HyPnlTenX8 XNs/pTmLZ3Nb01nO8PzA8DVmpxkt65/QvP1wpK50F+bDKvqlf9mJJyZnLDMm71re7xB/ vZ02AeiPb3LbbCBgNzd+VKAzPqQ2ji2B9ZMsODDTq+1znsAIoESAyl56UCdfcMMU6JHC k6LEdK7ouPzfaSnIkFjBVxLhNDIrR5B5OtRYdHBPV6v06NCXlhI/0qHFruA/A6VZ14u+ rB8A== X-Gm-Message-State: AO0yUKXQLnaexamMLXocsR8O2Hj3WF0a0qgljfWw4DVH+pw1qbHP7/qk Iudk0Set04xaDDoVOg1xH8kN3+IctnlelHur X-Received: by 2002:adf:ee07:0:b0:2c3:f880:bb1f with SMTP id y7-20020adfee07000000b002c3f880bb1fmr2284540wrn.14.1676477885607; Wed, 15 Feb 2023 08:18:05 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k2-20020a5d6d42000000b002c4061a687bsm16206609wri.31.2023.02.15.08.18.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:18:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 15/18] hw/isa: Ensure isa_register_portio_list() do not get NULL ISA device Date: Wed, 15 Feb 2023 17:16:38 +0100 Message-Id: <20230215161641.32663-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Previous commit removed the single call to isa_register_portio_list() with dev=NULL. To be sure we won't reintroduce such weird (ab)use, assert dev is non-NULL. We can now calls isa_address_space_io() to get the device I/O region. Note we can then remove the NULL check in isa_init_ioport() because it is only called in 2 places (and is static to this file): - isa_register_ioport() which first calls isa_address_space_io(), itself asserting dev is not NULL. - isa_register_portio_list() which also asserts dev is not NULL since the previous commit. Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index abc1bd0771..59f98472d1 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -113,7 +113,7 @@ IsaDma *isa_bus_get_dma(ISABus *bus, int nchan) static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) { - if (dev && (dev->ioport_id == 0 || ioport < dev->ioport_id)) { + if (dev->ioport_id == 0 || ioport < dev->ioport_id) { dev->ioport_id = ioport; } } @@ -129,6 +129,7 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *pio_start, void *opaque, const char *name) { + assert(dev); assert(piolist && !piolist->owner); if (!isabus) { @@ -141,7 +142,7 @@ int isa_register_portio_list(ISADevice *dev, isa_init_ioport(dev, start); portio_list_init(piolist, OBJECT(dev), pio_start, opaque, name); - portio_list_add(piolist, isabus->address_space_io, start); + portio_list_add(piolist, isa_address_space_io(dev), start); return 0; } From patchwork Wed Feb 15 16:16:39 2023 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: 653717 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431784wrr; Wed, 15 Feb 2023 08:19:18 -0800 (PST) X-Google-Smtp-Source: AK7set+5tybZkg25ptWssRC9iW5bN/ob7duRVLGABtsfAodKgcwHgqLGM5Y3K0H8glkglgQlXBGK X-Received: by 2002:a05:622a:4d4:b0:3b9:e683:23d with SMTP id q20-20020a05622a04d400b003b9e683023dmr4203887qtx.38.1676477958469; Wed, 15 Feb 2023 08:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477958; cv=none; d=google.com; s=arc-20160816; b=GoDw7kbPcl8uCwm05FXS3OnZSJagn1U+4EX0O402E0Hc6nYbEENW4Oz5qFhcja3Yyq CYHtRTFtmolRLwOuelp8tQxTue6cSdFwm2O98SkEgxYgy3I5p5E5ISBREqLTEmlWBuaF ToEjjkM6s/Avv1dWlcLyPQEmttwpA1wS+Bf3fFZjYKc9nicPQcFdEBLTVQr8TMh75IP0 oBxIRIlEO3v3icRKF+S4XMZVPrm0cqjkiUL8uOFNLK3dNdpK8T2uCIquhcRdPL/gnJUJ /pBp/cJQr+Mrc0q4eQ8BXeIqE6hiQ9O8/EA9pxmS/RTy0/TcOavvm8UuvNSbPHXRSMwW FDtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5fxrywMmBKVXBb0mf5wiJ7U1A4VldYjXsfGNyFlwAQ0=; b=GDi52ChxA+0HJTFnZcXX+UtmpSWTZRH3wsATHNOqnlNsm/r1fabVtLWew7zi32wIZ1 Y4w9sq6+BBEWbp4nS7pnfbhCdpY/HcMnbyuV8/unCEuIi4jlKbSlQGt+oTYd/fzdHYaM rpYyc2wKV6KAUEItyG4rk227LaPX3/PlUw2wIo3blXxTAXQrp6YyGTDbtoPii6RvMbbc r5HuXEbHOSvA+NDt3LlqOOV8ChfDNESxoPM5Q4EuojIjjBxY+QMSDFf2fZPvWYjhoH6W VNcDWI5VXkE56lF12RGoNBNVm4u2iuPUhQq26ugy3Lyi9+Ial8AwK3urW0XCystYAQM+ w+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i869EaJR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p7-20020a05622a13c700b003baff037de4si14742517qtk.449.2023.02.15.08.19.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i869EaJR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUe-0001dl-UL; Wed, 15 Feb 2023 11:18:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKU1-0000Ad-LD for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:15 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKU0-0008Sj-1n for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:13 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a2so19725347wrd.6 for ; Wed, 15 Feb 2023 08:18:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5fxrywMmBKVXBb0mf5wiJ7U1A4VldYjXsfGNyFlwAQ0=; b=i869EaJR7lzLgkV61QLdpaCpz+WXW0PrZzeZjuZzzfVdfFur7cFg8W3RnbIH7LrWuE GWeVtkvMcApqDjL0YZfhRJIbOVq2q3+QG6qYCDI3oYpGNcNW/I1oSO6xNhJToUnXVRFx hcaGCUIXPg9kyqt2P3mlmir6w8FBU4kffEHHj6UOjrb+EmL2tojWMS3UjEC9ILB5diOa CpjHs9DHQOk227ogdDkba2+GFUuVGbjpi3vwKNZTaSGYs1j6K1lo0OONF74Id92osYAa +BrL36HqBW2xcFXt/WP3E/R8L3WE1yBng6mzTUoq0EcNgQrzzSJkDJQAp30AKBfcqH6M AoXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5fxrywMmBKVXBb0mf5wiJ7U1A4VldYjXsfGNyFlwAQ0=; b=FldVSxH1slZ9JuMMSYrRctA3yZ8wKxzgrNCejZjy3YfTJO/lTiHaEiKUAv4fzJBH57 6H+QCdVDyfKwPlZE4YlZGOFBOVamcAJXheZpgkJQIE0+mTgXo4kNscVXXok1+HAkOZ+A KM8quYf+zwMUlatKevV8708cOgP1beMrj4KXEZRnwxpIbcxfJ3q76zhrK0aV2EvdLCOo PvULMLYWsUKM82D3wnxa5VHL6NGWvZ9wGehQ0sI+27j+MibhbwUvNk5b8hrcgqBhLYBF DxAT+BjEBK7iQInFmlIgd1QufO3/Sxenbrs+Z11y396ftA47jZmS9mkVMciU/fIFiAjU O5aA== X-Gm-Message-State: AO0yUKWVp8kzClzBvGFuM7SGd0eMBJRJjZuUtbazZ5IjJT77dA+M6F5t 0PWv5A6js2tk3JjsEV9ITvtilDTL+RA3DVgw X-Received: by 2002:a05:6000:1050:b0:2c5:5936:16db with SMTP id c16-20020a056000105000b002c5593616dbmr1821468wrx.42.1676477891194; Wed, 15 Feb 2023 08:18:11 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k16-20020adfe8d0000000b002c54536c662sm14461986wrn.34.2023.02.15.08.18.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:18:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 16/18] hw/isa: Reduce 'isabus' singleton scope to isa_bus_new() Date: Wed, 15 Feb 2023 17:16:39 +0100 Message-Id: <20230215161641.32663-17-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Previous commit ensured when entering isa_register_portio_list(), 'dev' is not NULL. Being a TYPE_ISA_DEVICE, the device must sit on a ISA bus. This means isa_bus_new() as already been called and 'isabus' can not be NULL. Simplify by removing the 'isabus' NULL check in isa_register_portio_list(). 'isabus' is now only used in isa_bus_new(). Reduce its scope by only declaring it the function using it (this will allows us to create multiple ISA buses later). Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 59f98472d1..719f2e96f2 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -25,8 +25,6 @@ #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -static ISABus *isabus; - static char *isabus_get_fw_dev_path(DeviceState *dev); static void isa_bus_class_init(ObjectClass *klass, void *data) @@ -52,6 +50,8 @@ static const TypeInfo isa_bus_info = { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space, MemoryRegion *address_space_io, Error **errp) { + static ISABus *isabus; + if (isabus) { error_setg(errp, "Can't create a second ISA bus"); return NULL; @@ -132,10 +132,6 @@ int isa_register_portio_list(ISADevice *dev, assert(dev); assert(piolist && !piolist->owner); - if (!isabus) { - return -ENODEV; - } - /* START is how we should treat DEV, regardless of the actual contents of the portio array. This is how the old code actually handled e.g. the FDC device. */ From patchwork Wed Feb 15 16:16:40 2023 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: 653722 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432120wrr; Wed, 15 Feb 2023 08:20:00 -0800 (PST) X-Google-Smtp-Source: AK7set+1bfT0iLk0zBNdF0rpfMw1MVz7wHoxqajMAyHf0Hek45KatAoII4+JBodo+tv192EJoZTr X-Received: by 2002:a05:622a:5ce:b0:3bc:e507:297 with SMTP id d14-20020a05622a05ce00b003bce5070297mr6011877qtb.21.1676478000025; Wed, 15 Feb 2023 08:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478000; cv=none; d=google.com; s=arc-20160816; b=gP7FhXTLVA++O6J967IXPDMOetCfGV3aWTehSNWds6gseSjmyGyaJzSD2hZzkAZ+xm zYpw8MmYR0W3U2E2PgP78bZB5+G17pEMlRkGds63vvLOj3FRa9bF1/iWjeAfiaFeGyuh iiH3/gENknZBxtqWlhuY7WGgl70Ca9vi6KpaQE5IoQ0YtoZJ1mSWHNnlGEWFcvSk5CV3 HXirehP5VfkGjEhKiZsZKUINPF7H5MvDgYnYVux//953hsfcEqIRbWqxn7eCC+S0QkOR 1LAshq04ScKKrJwOzIvtiDwR/cKzOlH+oJvm4TWJYME+87zw2mmBB72ndcgspP4McEc5 ARWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=byjwIFfgSe6JHFt0da/kKLLZa+4oG9V3qoed2WoaFQk=; b=cJUHnw8WzAh75SbdRoT+4rFmCIuuq++QFAgUrAkXd0Ab5anMYLghZI+1+13TmXMatS 5ttZ5mPuZfiaQkKjFQdDF1/d9+6NV6d6t0RstLj5BkEC/WzJ3MSKCbzQ/s4W3HJ0AQgL kqw37Z3Q80wd1n6or36ObDw7NZnk16othev4EkpsyrmOVRFdWa4cPzxr0IFvQj8BqNBt qZb92QCD+2yft4L7bzg2Oaa4dN96/FqQfkIbX1guHHVUv8BoTSAlG6E/nQbpZdRCqTnx G/Rve38o8A8XLahqikWTllrNBLwmxIYlBd8HbhfZtbwPkOpjQV4NT/qZihPhSII69mDJ 3qZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fx2gl8li; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5-20020ac856e5000000b003ba356296aesi12672167qtu.665.2023.02.15.08.19.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fx2gl8li; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUg-0001fz-Qq; Wed, 15 Feb 2023 11:18:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKUI-0000hW-SC for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:39 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKUA-0008RO-8n for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:28 -0500 Received: by mail-wm1-x336.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so2641325wmp.1 for ; Wed, 15 Feb 2023 08:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=byjwIFfgSe6JHFt0da/kKLLZa+4oG9V3qoed2WoaFQk=; b=Fx2gl8liRVKqMxhcMCOMGskxTZCveOI02Rpqetf9cnG7LOJ/0mxePZCNHgd0ptdkTj 3N6Fk82BcwsRrtqltrS8AoVHbB7kJMoTmgai5dZuSjI07nzveu/1iAWQ0+HjvBTFqC6z 575Uyh7r/TcAx0cPvrRGIx2AdzRIWddI9k9XkDqddXv5+3nEZwkSP3UcLOIYtMLWnzUb hFDAoAL9N+/SVHMiraNIrvuCj64a/JpFnjcrM/8yGbs2/S6sk41dir8U8meFV3qW407i b+YfvFJ1r2zAw3/7V4b6nefZz8lYRCCU8GMWYs22j2MUmHOgfrkIAKQphaFcsy+AUpgp LPrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=byjwIFfgSe6JHFt0da/kKLLZa+4oG9V3qoed2WoaFQk=; b=mbjaQi/WylLj6jN4zGNac0PuuIe4TpFAhuYX52a+zL/YZQTAYKz6vF0pt8pnIDGrDr f9CpC1BPOD0MMHiIko+zsayXlY3GAEr34bcO12rDrN0bKF9okr31Y5nUnE3Uz9FsMYVS /cCoffcZAXtKyV3kvlvUeaSTvu9OMuao1dgPwmsktXs05GUnzlzYYKfOnNyvweFwvWXt HlJmXvhWnrEaYqNTg9uKDTxU1CQ0INlMcJzXKlVq4W6EzFA4sw6YHPeCE3He9hNTnMc9 Od2TFFUBvPEWMj8+hfjrfuzAJNif4Jcaca0A/lPpBJE2vLx3EB3QufuDXGsevBvm7mZA MR5Q== X-Gm-Message-State: AO0yUKV3LTyU11hKrs2ZM95IB6PR1UYch2iutWGI34Mty5OSEljBh6A5 tQxl936hQnUXjFqMI6NSQ3qA2yzSsq4iUQCC X-Received: by 2002:a05:600c:997:b0:3dc:5b88:e6dd with SMTP id w23-20020a05600c099700b003dc5b88e6ddmr2389642wmp.10.1676477896328; Wed, 15 Feb 2023 08:18:16 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c3-20020a7bc843000000b003d9aa76dc6asm2461380wml.0.2023.02.15.08.18.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:18:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 17/18] hw/isa: Un-inline isa_bus_from_device() Date: Wed, 15 Feb 2023 17:16:40 +0100 Message-Id: <20230215161641.32663-18-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org No point in inlining isa_bus_from_device() which is only used at device realization time. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow --- hw/isa/isa-bus.c | 5 +++++ include/hw/isa/isa.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 719f2e96f2..f44817b88b 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -167,6 +167,11 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp) return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp); } +ISABus *isa_bus_from_device(ISADevice *dev) +{ + return ISA_BUS(qdev_get_parent_bus(DEVICE(dev))); +} + ISADevice *isa_vga_init(ISABus *bus) { vga_interface_created = true; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 1084d68ead..c9954a7d99 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -96,6 +96,7 @@ ISADevice *isa_vga_init(ISABus *bus); /* isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */ qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum); +ISABus *isa_bus_from_device(ISADevice *dev); /** * isa_register_ioport: Install an I/O port region on the ISA bus. @@ -133,9 +134,4 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *portio, void *opaque, const char *name); -static inline ISABus *isa_bus_from_device(ISADevice *d) -{ - return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); -} - #endif From patchwork Wed Feb 15 16:16:41 2023 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: 653718 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp431862wrr; Wed, 15 Feb 2023 08:19:31 -0800 (PST) X-Google-Smtp-Source: AK7set+i8GqFS6cG0eEJjAHAe5nD1HnfUlZ3gir2MIff+QP6SD+LPPPQqdRZR5iYRnnfdKHIKJ+5 X-Received: by 2002:a05:6214:d08:b0:56e:afd1:64be with SMTP id 8-20020a0562140d0800b0056eafd164bemr5266431qvh.16.1676477970881; Wed, 15 Feb 2023 08:19:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477970; cv=none; d=google.com; s=arc-20160816; b=y7L1RoVNHI4hxHrf1cv3FeWQDOTxEfTNOJo5IinXOXsMP4rfoMeWkbh4OQSrJdLLEJ RVsvjEJZpfLsTe/deGldAB6YAH3OQnh9/eB54EyCLWWLLQ8Can62Ibyq8uPegrrWgpyP 8bLbd/I/Wdr43qNHuz/VzdYtjNNC/TqR7i1nHPjjy6s3N8La4nwEp0jnd5rMIA1m4+DK PKvtKYnVQv+x26ghoPsKtVHGCvQyFYSq1mPuBI/bjruH87dfx1o1GTJJx8b/Q/seYcIL wIrDMt48Af+vipacDiPYUAC4UPq6Z1LWCD86Ixdn+p60Pp/hmGkP+0vT5V7us324w7PS 8bXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LD5rkStWhPsurn1HFD1lkjNNWwxHwIUi8eBD9zvn0TM=; b=O3GblsGvr9WD7v3sLluUfBA23iXLakxbTUyCKThZuqd5xjPU1bBvXAZlBwEUPdxbDT OjpYz6c48KtkpBRlMDrF+tTPrNT/5bimee+j0qgMu1aSmDbi6bz/yV+1FNpNfrFuUBtb Fiaf4rQ/lByOJUm7z1EEk/+V/vghskn6BZO7HmEowry/MGp8qSz7ndFxt/3hhExMfnHJ q7s4+3W+qz8G4ssF/EZ5mrrO5iDR779bBKMXeQ/NRdt3AsNiRvVAoDvTktewR/10jIfc BiF0AgZN1HUrz7O7kba++H1dzeB4Hrd9+lXNWQJCiazAxZ8oB2Xiud919JeArz/2RhWk w4oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XSChZ2nM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h5-20020a05620a400500b007060e6e7f3asi16226927qko.180.2023.02.15.08.19.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XSChZ2nM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKUi-0001ui-Jn; Wed, 15 Feb 2023 11:18:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKUI-0000ha-Te for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:39 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKUF-0008Mn-5r for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:29 -0500 Received: by mail-wr1-x429.google.com with SMTP id h16so19693751wrz.12 for ; Wed, 15 Feb 2023 08:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LD5rkStWhPsurn1HFD1lkjNNWwxHwIUi8eBD9zvn0TM=; b=XSChZ2nMwIzsB5p0YpRdaMZsowG2sBThm/BC3chOHJkyrE4vMqA84gjrQFlr86F/NF zW7IfukolAc6XzUH/UW1XsWEGgNDSVTtKBcn3MdIiusnPvmHmvot8rNs52uuqaRMMGQt meZxR/QvJEmdeZSD98kus/EO38Jb/T1uDSajgQQReof2S9NkDuwP4TkUElmC1altLJQK r8XwtByVio/KBwPlvjacxkQGKf0tNxSm7aougdvHDYc+c/Vzoiq6iEhqYH/gGknxMHTh BK716bKLBBkk89Xhg+q1fbT6/mVTsGfzFUDxuhvB7uoffYGCwi1Bply1EFzymO5H6Keb OY3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LD5rkStWhPsurn1HFD1lkjNNWwxHwIUi8eBD9zvn0TM=; b=Yx7Mn42El4iztJey/UrycHARamZtbfCgo2XTSZgiL/gpaErlESM184TuZPyJ4jaekQ SpnHQuboza4uO4YlVRVRs1bxh7LXkbTc1QjdYd2WGgVYDziYDhvPvu58o3cQEJqSV1ZL qdPSRJKBrqgESHThS5qm5N+Hp4Qb17bFn6y0rUizgG7rQtjgPxcloY7j9llvdOPEzfkE dx1+C5FyMuEcm0eOPDZQCtJ5dfasRDd3WdD28c8fAujqesvk3kvNuO+RHjF7oHmfJX/X pKKSg2ndnT5aI3FKPkLXG6vJIr3UY4JDN6HcCQcQEcSOFJO3q0U5vR+RAemwiOF8jcFl 0kqg== X-Gm-Message-State: AO0yUKUwOPQSg0oHesq0ALCFSq8a7NZ5w9FsVcZNwR051M+FhKTA8yY4 elTMQGmd/zezLTDUq5d6X5XaTkmjlwwg1vAz X-Received: by 2002:adf:f5c2:0:b0:2c5:4c6f:27cc with SMTP id k2-20020adff5c2000000b002c54c6f27ccmr2035776wrp.44.1676477902107; Wed, 15 Feb 2023 08:18:22 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i4-20020a05600011c400b002c556f36116sm8783409wrx.66.2023.02.15.08.18.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:18:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 18/18] hw/isa: Remove empty ISADeviceClass structure Date: Wed, 15 Feb 2023 17:16:41 +0100 Message-Id: <20230215161641.32663-19-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ISADeviceClass is an empty class and just increase code complexity. Remove it, directly embedding DeviceClass in classes expanding TYPE_ISA_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow --- hw/isa/isa-bus.c | 1 - hw/rtc/m48t59-isa.c | 2 +- include/hw/isa/i8259_internal.h | 2 +- include/hw/isa/isa.h | 6 +----- include/hw/isa/superio.h | 2 +- include/hw/timer/i8254_internal.h | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index f44817b88b..1276f31826 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -221,7 +221,6 @@ static const TypeInfo isa_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(ISADevice), .abstract = true, - .class_size = sizeof(ISADeviceClass), .class_init = isa_device_class_init, }; diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c index e61f7ec370..5bb46f2383 100644 --- a/hw/rtc/m48t59-isa.c +++ b/hw/rtc/m48t59-isa.c @@ -47,7 +47,7 @@ struct M48txxISAState { }; struct M48txxISADeviceClass { - ISADeviceClass parent_class; + DeviceClass parent_class; M48txxInfo info; }; diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_internal.h index d272d879fb..155b098452 100644 --- a/include/hw/isa/i8259_internal.h +++ b/include/hw/isa/i8259_internal.h @@ -35,7 +35,7 @@ OBJECT_DECLARE_TYPE(PICCommonState, PICCommonClass, PIC_COMMON) struct PICCommonClass { - ISADeviceClass parent_class; + DeviceClass parent_class; void (*pre_save)(PICCommonState *s); void (*post_load)(PICCommonState *s); diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index c9954a7d99..411d12330b 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -11,7 +11,7 @@ #define ISA_NUM_IRQS 16 #define TYPE_ISA_DEVICE "isa-device" -OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) +OBJECT_DECLARE_SIMPLE_TYPE(ISADevice, ISA_DEVICE) #define TYPE_ISA_BUS "ISA" OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS) @@ -48,10 +48,6 @@ struct IsaDmaClass { void *opaque); }; -struct ISADeviceClass { - DeviceClass parent_class; -}; - struct ISABus { /*< private >*/ BusState parent_obj; diff --git a/include/hw/isa/superio.h b/include/hw/isa/superio.h index b9f5c19155..0dc45104d4 100644 --- a/include/hw/isa/superio.h +++ b/include/hw/isa/superio.h @@ -44,7 +44,7 @@ typedef struct ISASuperIOFuncs { struct ISASuperIOClass { /*< private >*/ - ISADeviceClass parent_class; + DeviceClass parent_class; /*< public >*/ DeviceRealize parent_realize; diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h index a9a600d941..1761deb4cf 100644 --- a/include/hw/timer/i8254_internal.h +++ b/include/hw/timer/i8254_internal.h @@ -58,7 +58,7 @@ struct PITCommonState { }; struct PITCommonClass { - ISADeviceClass parent_class; + DeviceClass parent_class; void (*set_channel_gate)(PITCommonState *s, PITChannelState *sc, int val); void (*get_channel_info)(PITCommonState *s, PITChannelState *sc,