From patchwork Fri Feb 10 16:37: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: 652341 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp1059514wrr; Fri, 10 Feb 2023 08:38:53 -0800 (PST) X-Google-Smtp-Source: AK7set8s4UWlJ2WFiwIPLvg/8eYRCWWDg40ASTzlRT2hJSMXb4QrdugaRyh2MEPAbOpLPGqGdTEz X-Received: by 2002:a05:6214:f6e:b0:537:e563:c33 with SMTP id iy14-20020a0562140f6e00b00537e5630c33mr28552972qvb.14.1676047133098; Fri, 10 Feb 2023 08:38:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676047133; cv=none; d=google.com; s=arc-20160816; b=qQJtuiGVHu9MdQOdXDZNUo6Oltt0IXzz2EVYLaHwujz5aJl2Fpi2efgbJFS9iwXJ2x MrgKV96k8rWTPGMrnjbh7a0yqbnGIsgJN/m7sRdQ0m2823MKVND5WRdoHfhUiWA26x2X hZ7miFifIlgaTuvJDvs/L88lDhl2LF+ovnQdEekRMIPrBdu5ce0sNcZi9JI33sV2YFL/ 9/AOew9qHWcZM3Wg/7EOTaH8EpO/Uaxf/z+HVqtryxXXJCMskJKCx8f9Q2glTWBtX1G5 1G0ExPzipaZRFDwmHdt2CO271rI1wI+ieVCK7fp4yra4h0Yy1yeEtBs3fI6VF6XkXTl6 OCpg== 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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=OnX/rgko73J0yvFprX3Sy9JhyFc2AzVVo4zy1NyWuiIN5C9qJWjCpW4lEcqc6yjoRD ORarcSBhjui73VUr9FUWsp+7/u0FFoVRYOo29MAAkoboqDB+GEqMn/DeYMLv8BFD1f3S 1CHWDDpOJBiousmWDhIdVwZoVTqemtgvEgptbbPV4zOIvZIl1cduc1T1OvQec4xbrkFn gh4IEflbIMq5uxuvHT1GBGQuR4X09LrgpomT6BzpSa9Z0GJTUOmm2CjeOq/5FQyBRLIw bMIOZyHEiylkNQGfIbRipj9jGpdj/El6W71YVQWDvtj+mjte0AeuCWYi+wMr1iRauG33 c5Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iNaBr1Jt; 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 z16-20020a0ca950000000b0056e9812162dsi851377qva.531.2023.02.10.08.38.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Feb 2023 08:38:53 -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=iNaBr1Jt; 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 1pQWPS-0000Oi-5C; Fri, 10 Feb 2023 11:38:02 -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 1pQWPK-0000OO-9E for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:37:54 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQWPI-00008K-G7 for qemu-devel@nongnu.org; Fri, 10 Feb 2023 11:37:53 -0500 Received: by mail-wm1-x335.google.com with SMTP id o36so4249824wms.1 for ; Fri, 10 Feb 2023 08:37:52 -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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=iNaBr1JtiKBuEPP9K33XyQEly/Bh6gg3B0lqoU27fmR9rHb2x0926RKsHnI8dWPFRY ZsySQhqZraW52yu7HCr2uDMeC4vHD+sMEH4cFtDR2qCf1mwAwHhwHPAj9meLzqiMdOdo 4nUDdwxyUWmZS0JWMDCP5C0It0PT+xtxH5gtGnvCMzgVS4T6oWafkIY0xx2CGEo9j9pW E5NgLOGLFMe//W5kyfIWifdk5JI112fqJPmiMBMAFBDQSbA+dK7NFHIf8l8WRKGU9Mdb L/T6TGGNLND0T8koDv1Z0TSHcoEIpWgjOJ+0HgV4BkmWe4lek/6dTS5oC81c12zoE/fH bhbA== 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=9wz1BonRBA4qQZKRmLhECiyYteaw1n0xGhljex2JkKU=; b=7i8JoKZN08w51AcFGfBnofrskCHeoAjD+Tcqx+s8aRB8DnZRGkHndPEG/mIjnZYF3R INphokFIz1Kj24y9W4jwNTitWKDTK7LNv+wjHgGcQnct8bfU7kiuwrHf1r7MGqdUyR2O wHEHTujwvsWOtalkQ3yJpud/DC7A2r6lFxxN2n58wAAnJFczveBLmZAgf/P5+z7ZzTMd 6ULNHa3CGiXkvvz9RRUAvm6PNfb9X/2TZa6bWG+WHhSO8wYYTKgZjlmSKALwKTBZlaRx SxTsUXxIVnd0Kq+s9imOC3rLyOFkKmcppFMDIQ4p5hGFrX0nx/m1hN8P4yrvPvemy/DD HlCQ== X-Gm-Message-State: AO0yUKWhot7TGKOkwwLsAqFMJMGMoxXes096kqBwmDNff/pICC6AuF4H 11253h9WvdwOTeoRRhJa6/sa9VD/JI+7DvIJ X-Received: by 2002:a05:600c:3420:b0:3dc:4548:abe6 with SMTP id y32-20020a05600c342000b003dc4548abe6mr13354159wmp.12.1676047071696; Fri, 10 Feb 2023 08:37:51 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n19-20020a05600c3b9300b003daf7721bb3sm9399325wms.12.2023.02.10.08.37.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Feb 2023 08:37:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Sergio Lopez , Richard Henderson , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini Subject: [PATCH 01/11] hw/intc/i8259: Document i8259_init() Date: Fri, 10 Feb 2023 17:37:34 +0100 Message-Id: <20230210163744.32182-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230210163744.32182-1-philmd@linaro.org> References: <20230210163744.32182-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 --- 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);