From patchwork Wed Feb 21 21:16:20 2024 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: 774531 Delivered-To: patch@linaro.org Received: by 2002:a5d:6ac2:0:b0:33b:4db1:f5b3 with SMTP id u2csp461974wrw; Wed, 21 Feb 2024 13:26:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1curkzP6biPPnGlIHqH5kKm47RSksf+FPIIUhinrsHT1ptq2GSO8Y0XGcvBKeV5NykKgPit1fOZBiYlv/8t9t X-Google-Smtp-Source: AGHT+IGlUIzewhkloT4dxTOweK3GML0IQoe6dGNKeq99zw0O7hoPWXynH0cogK6IqCxnfOf+KbYy X-Received: by 2002:ad4:5765:0:b0:68f:2a5e:4fa5 with SMTP id r5-20020ad45765000000b0068f2a5e4fa5mr28384081qvx.11.1708550766703; Wed, 21 Feb 2024 13:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708550766; cv=none; d=google.com; s=arc-20160816; b=K4qWNQvPl/ZrDN6Knex16WWFakFZq4tSs9In48KoMbvODht97GOIbQjJ7tK3jw/yD0 31AuBuaROJsTDDYNYOFodH+Jzz2qz6molvknFccDGyXCRDhvv455rYQkz8EcOj0ruVwd ZuOEDSu0eFrbxyDlrgHqwnR5Flda26IjTxtHjZEAaOwT298Fofy9v0ChJ9BGjOEcmlcN WVdA76mo7mCLSwx9FGWtIPNHV3VZJvoqa5aTOdkHYLvrg4DQ7FJCGkQz0/HPydccgapE UWMUCNdnhCxcpoZAFe0CXPgMwhB/sJR9EgdcryQ2fkRItmaFr9VgXm1wZGx7+i9wvhfJ w8fA== 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=fAdVq5rUcil5gs4UnSlEI8gmsHzEwxxSsfugjfa7R48=; fh=5cA6FzatP5fS6W/Tt18xlG6cH7utM3ZrQCPKoe4O9n0=; b=C5lhzQLVTMNEp7EXyGlCwW3DE3x/TWU8FF5vLjIaLBU1v0/8U46s5sqKDLWcXf1Q0O ZQvXVt6kMXuFwpxorS24NKGT+OtDyU8AQoCXmFNoI5mJI7YEKkGAR71RJ+jy1Fgl9oB6 oaBxQXW5/Rac6TmShfxNFCTcSWdwZ2YmaIoq8fTD/yUBiSiA/1lngCnsV+RRXaW7uPau BO9ZiUAFoftkjfFb3l786XLPPedhASnNWlSZYscSE5qtsDk6enaYxs3DPXg8oIZy9XRE /9doRxdj/EIKu9M121GpFis2ytdU8YWmfeWswtzoQ/ePkQTuuhxxWfAON9L+Tvxamky9 hZmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGEBAiIs; 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 gi8-20020a056214248800b0068cce1999cbsi12203081qvb.420.2024.02.21.13.26.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2024 13:26:06 -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=RGEBAiIs; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathie?= =?utf-8?q?u-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Message-ID: <20240220085505.30255-4-thuth@redhat.com> [PMD: Use IDEDMAOps typedef in struct IDEDMA] Signed-off-by: Philippe Mathieu-Daudé --- 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" /* debug IDE devices */ #define USE_DMA_CDROM @@ -18,8 +19,6 @@ typedef struct IDEDevice IDEDevice; typedef struct IDEState IDEState; -typedef struct IDEDMA IDEDMA; -typedef struct IDEDMAOps IDEDMAOps; #define TYPE_IDE_BUS "IDE" OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS) @@ -332,13 +331,6 @@ typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKind; typedef void EndTransferFunc(IDEState *); -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; }; -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;