From patchwork Mon Feb 27 14:01:00 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: 657064 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2379901wrb; Mon, 27 Feb 2023 06:25:55 -0800 (PST) X-Google-Smtp-Source: AK7set+W2VEboivZeIUrTZ584zgJfbroF3Gco3ZIRrRK/NDtg/Vnc2df7xV9tJ3Xu427zxsHPN5C X-Received: by 2002:ad4:5c46:0:b0:56e:a630:2626 with SMTP id a6-20020ad45c46000000b0056ea6302626mr50898528qva.45.1677507955690; Mon, 27 Feb 2023 06:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677507955; cv=none; d=google.com; s=arc-20160816; b=SRX/drM4HNcf6oEzVrhn535+9JLPaZM3YgEsmrbPOU1uqQ4dhJcjDzfAEw0Zn++go3 3KDXXxzWBwrYIkjTi9kptlIW67ex4my1tFfOTBerpUN8vxOIUupe5KrIQ2RNcPtYBos1 Gga8m45QmbRQ7SkgBrj087W22FlXNVC3l4BvikVyyXfS0WWRDLlJDtgIWUhfDFyjQF78 IS2f/t1yhV8FDowN6dlEMMVaGByzPii6Udk4WfuxvVLxZWDSa0Lmm6BHovG1maUu1qSB ZWzzjZhOnAec+zhm5uf/NQNbi1xDvSwdnnDDlm+RvFNa16cE+QphCe/31T8JG6BgD0Ac x8VA== 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:to:from :dkim-signature; bh=f5yKWrXeohH1uxONlv1fkqGC/gbeXOjcvaKLR6Gd1Wk=; b=HNGs9HJozmkdB+DIsOyzM3HGMhk0HcsAATGFj09TbsYWaxjOlW8Azwc2l7+J7KI8Pb kXO5NeB4GUXjDn9XHgEfal8o7phhYOqS6leXu0oVs4ctHI2+ZLGTa++cmE3yc2IaYYmT JdCBJ/iDNuUz8G0ocTbhtvBCch5vFrP/MCJttuc6PiJoc9cuK0dSe02VgQdBCUrapJZq DgL0cuq+t6JfDJl1pgFQEItrkEzyIha6BY89z/N8Hx0uH77PrqyLyq2s9Tyyz81Q2/5y eByzjZFAO3wJspn/JU4ZrelxBUM/54RUNiZ6xG5a2Y1UBksf/BWvTmd2pgqwoXu5Q8nY 6wFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CnJp5+4I; 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 w11-20020a0ce10b000000b0057111221a51si6211163qvk.332.2023.02.27.06.25.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:25: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=CnJp5+4I; 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 1pWe8w-0005Wv-RO; Mon, 27 Feb 2023 09:06: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 1pWe8v-0005PN-Ll for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:06:17 -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 1pWe8r-0008V9-Sp for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:06:15 -0500 Received: by mail-wm1-x332.google.com with SMTP id j19-20020a05600c191300b003eb3e1eb0caso2606323wmq.1 for ; Mon, 27 Feb 2023 06:06:13 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=f5yKWrXeohH1uxONlv1fkqGC/gbeXOjcvaKLR6Gd1Wk=; b=CnJp5+4Ii011Ume+8cj4f1dtd+ngX3f5pY67TUfYk7Zvh2mWs5CFkOyNeYgh7zFoUg itdO3D5SNfaf4nAKjL9+Sao/f9+RHaj1giDVRaGhVTseaOCtKBvynKoETlrS8gcazh8h oKV6X8/b4A80Js9VMj9i9cuah9o46nKpltRVBvNutgSd4grqS/0H/Zu61dAufPf0DRaC ru9iBJgvohrCd03ZBTnP5qRO/vN5VfVcbWE7Q1kXy0zYek6vjf0W7UFsjXoWERzbtBJR AVWQhmsOl0IR8QB5ShS3IAsN6gchp0TmzBkLnrt36O2N89PwgBYO39n9h5xKjQQzH6kU 43Lg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f5yKWrXeohH1uxONlv1fkqGC/gbeXOjcvaKLR6Gd1Wk=; b=OGLLBIoiI4gOj+29WfuCyW+kKtl+cWublota65Bjz/cD0fiTo0ba8Gl5e0rikVmSHl GOxRc2puW1YS5k14C5tyF5LA93lzVMqkyxOGdTMT3Sdesn3mgqQp9jn2/VvVz5reHhbZ JcRDa7oKfl/ugs2rv73ph3HgNsX+NfMCtbO25o2xklr/5O2eqzoq/BbQGi+ULNR1WbhX 7pRzJN2EhHHT9MRgGXTGnP+gByfMbU40N1R/e3GzUuiEiDpUsKK5dxWmnQ6d7GnWfTr6 /zpeL0XuX993rf4R7du+o3fU9SEgEG0fyuM0i7mJIpbdKKeRTZny5CF4+VI+hK3PQz4r QWlA== X-Gm-Message-State: AO0yUKXmrRF+c9tthR/8TWDfGPIm1Mighnv/5MlS8Alcf65tqspB93Uu htL2jGWj83YdjHa1LbioTIdUQhe8TBMAIOn/ X-Received: by 2002:a05:600c:3413:b0:3eb:2de9:d01 with SMTP id y19-20020a05600c341300b003eb2de90d01mr7415997wmp.18.1677506772902; Mon, 27 Feb 2023 06:06:12 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o6-20020a05600c510600b003e20a6fd604sm9920636wms.4.2023.02.27.06.06.12 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Feb 2023 06:06:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 053/126] hw/intc/i8259: Document i8259_init() Date: Mon, 27 Feb 2023 15:01:00 +0100 Message-Id: <20230227140213.35084-44-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230227140213.35084-1-philmd@linaro.org> References: <20230227140213.35084-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=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 i8259_init() helper creates a i8259 device on an ISA bus, connects its IRQ output to the parent's input IRQ, and returns an array of 16 ISA input IRQs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230210163744.32182-2-philmd@linaro.org> --- hw/intc/i8259.c | 4 ++-- include/hw/intc/i8259.h | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 0261f087b2..17910f3bcb 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -406,7 +406,7 @@ static void pic_realize(DeviceState *dev, Error **errp) pc->parent_realize(dev, errp); } -qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq) +qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq_in) { qemu_irq *irq_set; DeviceState *dev; @@ -418,7 +418,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq) isadev = i8259_init_chip(TYPE_I8259, bus, true); dev = DEVICE(isadev); - qdev_connect_gpio_out(dev, 0, parent_irq); + qdev_connect_gpio_out(dev, 0, parent_irq_in); for (i = 0 ; i < 8; i++) { irq_set[i] = qdev_get_gpio_in(dev, i); } diff --git a/include/hw/intc/i8259.h b/include/hw/intc/i8259.h index a0e34dd990..c412575775 100644 --- a/include/hw/intc/i8259.h +++ b/include/hw/intc/i8259.h @@ -4,7 +4,15 @@ /* i8259.c */ extern PICCommonState *isa_pic; -qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq); + +/* + * i8259_init() + * + * Create a i8259 device on an ISA @bus, + * connect its output to @parent_irq_in, + * return an (allocated) array of 16 input IRQs. + */ +qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq_in); qemu_irq *kvm_i8259_init(ISABus *bus); int pic_get_output(PICCommonState *s); int pic_read_irq(PICCommonState *s);