From patchwork Sun Oct 30 22:28:32 2022 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: 620051 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2453144pvb; Sun, 30 Oct 2022 15:38:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51QiN8+dyjg7w5j6N6Ss1DqWl15JOg6goDnaomvpimS/3BXminwf8MrBI9Al5NM4aGUtuq X-Received: by 2002:a05:6214:5181:b0:473:1a26:99f6 with SMTP id kl1-20020a056214518100b004731a2699f6mr8522883qvb.47.1667169492965; Sun, 30 Oct 2022 15:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667169492; cv=none; d=google.com; s=arc-20160816; b=xcrDxoNAk3ItWmzzmkzBV0s8f55P5BwlaMvdxHWF8MbBvEq/6/891ZMmjqOQVVwga6 wN+jMiwXKf0OyW7Ag45L0jku8V+PXLALy7jY8bY7aFWeZ+5qlEGYYLo0Ryl/WJhmLGIK g9SeIy7oaozU/bmf4IkkhbyxAJSkZ5Xsu8o5rRkl8vzRNlIWr49adjNRajSWI4Zihuyy B6t0BriXlhQ++16vnyWcC56xEOBzskFzlqkVr0OGkQsrDTLBCCklaULA+biUaG2xIfPG LslNzxE3qE4Cdy2R6J5IcEdiUOGU2L+mSkugW+WYYJsP2SZwF8gKX5NTwWmg0Uy7ZOvx 7s/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=EIPy348rkZZiVPh95Imhce2HNMSkn2kK59cH0xc0lRQ=; b=kC+op3qcZ70RwTrjdBychsH5KFjxNSI0hOW2UAIIOIrm0dd1tgej4MfDwOfHpJRSMb erQYmUJz70FQAvdgAf0lhOoD4upXkA/rX9ldJbL6/aEd0hhFVqnnZcUfbmDvKOtUJE4T LQWYqM3FtwT04QgXj3uSY18iN2Zyc0adX4RuBShfav9vvuDd0Lny1IpZhnSzJd01a7Yo fHWd4pV1l33Rr4CP6yUyhptxUc8LoouQ0l5GXl9TTaY/4ZcOLi9WyqjIvvODjPAkEVVx Yff8n9MSo4wLghoE3YEDjpgK1m4EtYGMppelHvdOsKmgN6K2WNX9sBLELjMMFCd2U8HF iZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXBFsUeL; 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 u30-20020a37ab1e000000b006eb9975e33dsi2675247qke.513.2022.10.30.15.38.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Oct 2022 15:38:12 -0700 (PDT) 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=RXBFsUeL; 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 1opGtr-0000pv-Kb; Sun, 30 Oct 2022 18:35:27 -0400 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 1opGsI-00043R-6V for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:33:50 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opGsG-0000La-1s for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:33:49 -0400 Received: by mail-wr1-x436.google.com with SMTP id h9so13724568wrt.0 for ; Sun, 30 Oct 2022 15:33:47 -0700 (PDT) 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=EIPy348rkZZiVPh95Imhce2HNMSkn2kK59cH0xc0lRQ=; b=RXBFsUeLl2iKBU1l75mntZeXOFt3ivvmefUFzUpvxcJ0UfuJCRts0giw8ESnlWzhC7 IUfVzUpBhnrtcFByRokFbsZlhdeS75vssn+axnv27jjdSRZFEmIL1B0LehW24BPGBHsa iqchWhy7a65TbIJU+PhGWwdu+Pv7qsGgrLnjy8b2ylq57JDggcUn94P0ntrOfF2Txt8i 6gJNRMBAZONeEsl6Y+Uc7dAmecL21zmh2Tsx90jIgeuqURnIrh4vG2IuZza4Da5wtB5Y W8Yq9viEoAWBo5GSzG1DdVFyab2h4VFze4cbOZVKft3JJgRyg+l5tnrYYBG9DCrku0ky locQ== 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=EIPy348rkZZiVPh95Imhce2HNMSkn2kK59cH0xc0lRQ=; b=1yZk492amdIhlP8UCmjvLvDfjEigto1SCSRssFb6wUggu7oO0RQ9OR38EBvzDGw7qd Bj3fObn8TZRdJCdAuNzGrLpYjZHdwdYGHj1QGv08/GrYySDNbh3U/lsck/iEqCFsG7gm Z1ZihYIXdws9K3PERtpJDuv0vyYuYD6IBcj/kCS0r8seadOPvSVy4YRfQb3bIZbUAwnZ /dETD6sZt1zsBnVnRTUq4nEIlnEFMh5D/XmpRvSnbcDAmJUzxUvHu+tN7jWWS7bTVi++ LfHYnfJbCJDEfS79awoSBZvFxYq7pQdNyg/6W/EyLjC3pkmZc8NW8J4pRYP1muXwXqRD qQIw== X-Gm-Message-State: ACrzQf0218oekNiyBpcK5YBrUUzg/6I0I14m9UXscoxi59gCtbPDVOoq y0gt/eO/Q32eDN95hBxaLr6N+mReJwI5Bg== X-Received: by 2002:a5d:6147:0:b0:236:aa4:6eca with SMTP id y7-20020a5d6147000000b002360aa46ecamr6120136wrt.318.1667169226328; Sun, 30 Oct 2022 15:33:46 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id 123-20020a1c1981000000b003c6c182bef9sm5980174wmz.36.2022.10.30.15.33.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 30 Oct 2022 15:33:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Stefan Pejic , Jiaxun Yang , Aurelien Jarno , Paul Burton , Bernhard Beschow , Mark Cave-Ayland Subject: [PULL 46/55] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE controllers Date: Sun, 30 Oct 2022 23:28:32 +0100 Message-Id: <20221030222841.42377-47-philmd@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221030222841.42377-1-philmd@linaro.org> References: <20221030222841.42377-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221022150508.26830-9-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 3 ++- hw/ide/piix.c | 5 +++-- hw/isa/piix4.c | 3 ++- include/hw/ide/piix.h | 7 +++++++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 include/hw/ide/piix.h diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7a55b9ca8e..0ad0ed1603 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -40,6 +40,7 @@ #include "hw/usb.h" #include "net/net.h" #include "hw/ide/pci.h" +#include "hw/ide/piix.h" #include "hw/irq.h" #include "sysemu/kvm.h" #include "hw/kvm/clock.h" @@ -259,7 +260,7 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PCIDevice *dev; - dev = pci_create_simple(pci_bus, piix3_devfn + 1, "piix3-ide"); + dev = pci_create_simple(pci_bus, piix3_devfn + 1, TYPE_PIIX3_IDE); 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"); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index de1f4f0efb..267dbf37db 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -36,6 +36,7 @@ #include "sysemu/blockdev.h" #include "sysemu/dma.h" +#include "hw/ide/piix.h" #include "hw/ide/pci.h" #include "trace.h" @@ -202,7 +203,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) } static const TypeInfo piix3_ide_info = { - .name = "piix3-ide", + .name = TYPE_PIIX3_IDE, .parent = TYPE_PCI_IDE, .class_init = piix3_ide_class_init, }; @@ -224,7 +225,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) } static const TypeInfo piix4_ide_info = { - .name = "piix4-ide", + .name = TYPE_PIIX4_IDE, .parent = TYPE_PCI_IDE, .class_init = piix4_ide_class_init, }; diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index c88d3bf3bf..e05e65d3bc 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -28,6 +28,7 @@ #include "hw/irq.h" #include "hw/southbridge/piix.h" #include "hw/pci/pci.h" +#include "hw/ide/piix.h" #include "hw/isa/isa.h" #include "hw/intc/i8259.h" #include "hw/dma/i8257.h" @@ -277,7 +278,7 @@ static void piix4_init(Object *obj) PIIX4State *s = PIIX4_PCI_DEVICE(obj); object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC); - object_initialize_child(obj, "ide", &s->ide, "piix4-ide"); + object_initialize_child(obj, "ide", &s->ide, TYPE_PIIX4_IDE); object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci"); object_initialize_child(obj, "pm", &s->pm, TYPE_PIIX4_PM); diff --git a/include/hw/ide/piix.h b/include/hw/ide/piix.h new file mode 100644 index 0000000000..ef3ef3d62d --- /dev/null +++ b/include/hw/ide/piix.h @@ -0,0 +1,7 @@ +#ifndef HW_IDE_PIIX_H +#define HW_IDE_PIIX_H + +#define TYPE_PIIX3_IDE "piix3-ide" +#define TYPE_PIIX4_IDE "piix4-ide" + +#endif /* HW_IDE_PIIX_H */