From nobody Tue Nov 26 10:52:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708550766; cv=none; d=zohomail.com; s=zohoarc; b=gwV8Z79tJZSSEk2Q8EdKU1+mDnJnS2CRrGnIAvH/+L7HS+Y5sn/DK8Q14xBGWpcSewgqS7MP/ZMYP921kpmfVfYKAF8V8gTs5nfdLUf9GC+jfolWUj6VUwTZxIT9B6/chVeKnC44Yzv8SzHfRfWCg6d9hAbByiWC1Xicu9EFlV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708550766; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; b=Az28uo9SX/VwXpPrgxy8vQrb4sQp1mXJYaTM/e08t10F8t/8c2EQp4ZFeG6OwqKStadQt6b0xmYAAdET3SYEoZlkHJhXbUK0evwmPDbpXwu9t1H5jWC/GaAwY2f/4eoxqHcqA+X3/KmHQpHIlxhGHR/ByszYx7T3ec2H+zxe8iQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708550766942657.3283573288018; Wed, 21 Feb 2024 13:26:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rctzl-0003eq-9i; Wed, 21 Feb 2024 16:19:13 -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 1rctzX-0001yR-WB for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:19:00 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rctzV-0001H1-4s for qemu-devel@nongnu.org; Wed, 21 Feb 2024 16:18:59 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4127706e48cso7725705e9.1 for ; Wed, 21 Feb 2024 13:18:56 -0800 (PST) Received: from m1x-phil.lan ([176.187.211.34]) by smtp.gmail.com with ESMTPSA id f9-20020a05600c44c900b00411e3cc0e0asm18723489wmo.44.2024.02.21.13.18.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 21 Feb 2024 13:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708550335; x=1709155135; darn=nongnu.org; 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=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; b=RGEBAiIsuiz5p+2U+o/EKQahdwdWlOmALej/ZeqRHMqk5+MnSIFdKcvPxU7+6xWAEO FJwgxNqjZlfF1A398qoYJJlPz9ppb4aj9vi2ODHmWxLo+OpPnLTt45bokIcKENP1h2n1 JEX7SgfY0lHEhLvtrZH9oxBzf3xqShU65/ftyhSEOJbASsalkDhZjdVrS1FDzj5dBF2o TiqDz1Tk+Ev1XyN0dcXrPyfYy36Hfr8tqEaTpTKh9d2cdHYcSWzIvyWbFuOU3f2Oqqwi lXlcI8EUV7J3ZtzcFNzyhzzfKUj3qIi5BEDYn4z1YMgslw8gmMChLqwxC9sFSkkrMmCy iokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708550335; x=1709155135; 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=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; b=xOXCJ2UcJF0A4V0eRV/CLxVuAaRn15lRuQjyoGP2cxkWZemVYQRQDW6uEjYytrxZXl MDbJM+UMkxshZBXMdidKiMOgMrKm2hvxXeB+U9xjAsSI3bfeBwVkuzTrf2df3vi+eSnJ B4zNK8QSkUYwgR2lnUm+vDdHeYF8CHeAu3cGOHuFNSkEzyFfjpnjIPT/Itp+Qs/9msZg bh3iHaZiYHBNKP3JO11zM1lsDEJ72TPAmlxJnA0YbEp6ENEwHQGNRaNRF93FJ4Okph0t m+fi6xr646QcyxRhkEv8Ok5U+piJQ4Ln1rDvOy9DNNMEMufnzY1TBavwoZNBUfgHftmf gjzg== X-Gm-Message-State: AOJu0YyTUMYUSgCdppWuer5iZhN3fQ/xbtwb3Bdsntrgxoqd51Yz8SBf CJlHGEZb5IYk5syKsFfG8ToZYqS12x2dyBZUfBUAEMsCOb306bSc02GZaeJcGm9j3DjLMgGVbkx UbP0= X-Google-Smtp-Source: AGHT+IHJchHfvCjeL2F82+lnM+IGqgqCsHthdrr+bFCleDy1AxxAqLjiDRdFPVWNzPnQGD1Lr5hGZg== X-Received: by 2002:a05:600c:46ce:b0:40e:f693:94f6 with SMTP id q14-20020a05600c46ce00b0040ef69394f6mr14433886wmo.35.1708550335180; Wed, 21 Feb 2024 13:18:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow Subject: [PULL 20/25] hw/ide: Move IDE DMA related definitions to a separate header ide-dma.h Date: Wed, 21 Feb 2024 22:16:20 +0100 Message-ID: <20240221211626.48190-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240221211626.48190-1-philmd@linaro.org> References: <20240221211626.48190-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708550768954100003 From: Thomas Huth These definitions are required outside of the hw/ide/ code, too, so lets's move them from internal.h to a new header called ide-dma.h. Signed-off-by: Thomas Huth Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20240220085505.30255-4-thuth@redhat.com> [PMD: Use IDEDMAOps typedef in struct IDEDMA] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ide/ide-dma.h | 37 +++++++++++++++++++++++++++++++++++++ include/hw/ide/internal.h | 29 +---------------------------- 2 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 include/hw/ide/ide-dma.h diff --git a/include/hw/ide/ide-dma.h b/include/hw/ide/ide-dma.h new file mode 100644 index 0000000000..d0b19ac9c5 --- /dev/null +++ b/include/hw/ide/ide-dma.h @@ -0,0 +1,37 @@ +#ifndef HW_IDE_DMA_H +#define HW_IDE_DMA_H + +#include "block/aio.h" +#include "qemu/iov.h" + +typedef struct IDEState IDEState; +typedef struct IDEDMAOps IDEDMAOps; +typedef struct IDEDMA IDEDMA; + +typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc = *); +typedef void DMAVoidFunc(const IDEDMA *); +typedef int DMAIntFunc(const IDEDMA *, bool); +typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len); +typedef void DMAu32Func(const IDEDMA *, uint32_t); +typedef void DMAStopFunc(const IDEDMA *, bool); + +struct IDEDMAOps { + DMAStartFunc *start_dma; + DMAVoidFunc *pio_transfer; + DMAInt32Func *prepare_buf; + DMAu32Func *commit_buf; + DMAIntFunc *rw_buf; + DMAVoidFunc *restart; + DMAVoidFunc *restart_dma; + DMAStopFunc *set_inactive; + DMAVoidFunc *cmd_done; + DMAVoidFunc *reset; +}; + +struct IDEDMA { + const IDEDMAOps *ops; + QEMUIOVector qiov; + BlockAIOCB *aiocb; +}; + +#endif diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 3bdcc75597..a3a6702eec 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -11,6 +11,7 @@ #include "sysemu/dma.h" #include "hw/block/block.h" #include "exec/ioport.h" +#include "hw/ide/ide-dma.h" =20 /* debug IDE devices */ #define USE_DMA_CDROM @@ -18,8 +19,6 @@ =20 typedef struct IDEDevice IDEDevice; typedef struct IDEState IDEState; -typedef struct IDEDMA IDEDMA; -typedef struct IDEDMAOps IDEDMAOps; =20 #define TYPE_IDE_BUS "IDE" OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) @@ -332,13 +331,6 @@ typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKin= d; =20 typedef void EndTransferFunc(IDEState *); =20 -typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc = *); -typedef void DMAVoidFunc(const IDEDMA *); -typedef int DMAIntFunc(const IDEDMA *, bool); -typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len); -typedef void DMAu32Func(const IDEDMA *, uint32_t); -typedef void DMAStopFunc(const IDEDMA *, bool); - struct unreported_events { bool eject_request; bool new_media; @@ -460,25 +452,6 @@ struct IDEState { int ncq_queues; }; =20 -struct IDEDMAOps { - DMAStartFunc *start_dma; - DMAVoidFunc *pio_transfer; - DMAInt32Func *prepare_buf; - DMAu32Func *commit_buf; - DMAIntFunc *rw_buf; - DMAVoidFunc *restart; - DMAVoidFunc *restart_dma; - DMAStopFunc *set_inactive; - DMAVoidFunc *cmd_done; - DMAVoidFunc *reset; -}; - -struct IDEDMA { - const struct IDEDMAOps *ops; - QEMUIOVector qiov; - BlockAIOCB *aiocb; -}; - struct IDEBus { BusState qbus; IDEDevice *master; --=20 2.41.0