From nobody Tue Feb 10 03:37:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) client-ip=209.85.128.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=quarantine dis=quarantine) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1642507431; cv=none; d=zohomail.com; s=zohoarc; b=frsiSipUJ77WsRg/nc+V79aocVWVZRi3yhZ99zJweVA3lSFhnqU29OP3RcAiziHvAYrdhv8b0V//Enz5KSISzbkgdbohnOQlTuWGQoCYG7uXNPvBlIno8mWutERufG+hVrIMEWPvhiQf7lyxI56P/+dphEdoz/TDQjZ9kYluePk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642507431; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iFVlmnRPeTBD8lOSH8frg7WRVHFkQ8F3wW1ER1eNd50=; b=ZBsvU5vLYB7J+1Vjt2yGUHzF2pcpiTt/O+Uq+xqJ2FfoFQq/Rr4szvSLrKkUIkt8r2mo3QF+1y6DSVyjY36pmHNEhcUgERX1M76qHtpY6uqIYzKTGCUQY2mLBj1/jeNTSkPBOyWnlPVfkM8MIXMogYplor8/YBsWPeLhKzS23ro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.zohomail.com with SMTPS id 164250743117077.38147645789559; Tue, 18 Jan 2022 04:03:51 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id l12-20020a7bc34c000000b003467c58cbdfso5240305wmj.2 for ; Tue, 18 Jan 2022 04:03:50 -0800 (PST) Return-Path: Return-Path: Received: from nuc.. (154.red-83-50-83.dynamicip.rima-tde.net. [83.50.83.154]) by smtp.gmail.com with ESMTPSA id e15sm5487832wrg.85.2022.01.18.04.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 04:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iFVlmnRPeTBD8lOSH8frg7WRVHFkQ8F3wW1ER1eNd50=; b=QY8mujHBXD5kQ8UvjT3oiwbEcNXqMllJYeu5nq5ERBr87KYi8LUGzH4aTLSGYW8Pjb NGSRum5ucFCx/Bm7/Pr6erpgCEWqc3pcTnQYn1f1JvLCt8vnye8OGeoljZO3sXQA8O8z jbzvDLxsacAitt8fhUqt+aZSIV447tgnWmX5A/a+mBYUONGrlaKPhXY7GmNWn9toL4g4 ygEE9C6XtpdBZOHwPVr06aA/FiS837MLIvYNCjy/U/WLROt6GOSnMIaTXm6RUDb67qks TNaAa2IaxMUNK6efCEloN/+MyU7P6Y7JOveGEk5Hce9+0uO+DN6qPAygmkbig7djKFp5 4sgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iFVlmnRPeTBD8lOSH8frg7WRVHFkQ8F3wW1ER1eNd50=; b=Rme54JdSwqKU1AkhegBO+eC00ZukuB6777YwC73EqN7ij10bRrHQq6oFI0p3tXseE+ DKCNEL1U+nIBvjT25qEgbAZSeGULycnFLNjJWR2KF9rfra3vLsxkBV2UyKFbADULEEdW 9neSe1kgd94vYX2lPhz2ZqXE0mScBd+nTdK0QeIp9SYIL8oN1q8x/6t50JMSU+pYgFNH wGpkncTz9PYYHUTqpLrWdISprdcB2vAbsSjX66x33qFefK4VcE/W4xIbJBLuL/r5pZIk ggZgT1I3Bb2v+uaDw9m9qN61pa9X9phtv0H8JFpON2MpbHmml2V/uGuk6H7gdImBgzeO BWYw== X-Gm-Message-State: AOAM531d7z+57Vu5SpP+mfyC7kro011HXOVcScoVnlFHgk4H00+sw2hH x9/BFOy/oSsh1InH69ZSwbvVxhBWKiI= X-Google-Smtp-Source: ABdhPJyKQkpTKFZqMOzFfBCZTokOb9fFWWiwOAIbY1DjsTbFbUbqzr85dpoKX64wlImftwegHZgQNg== X-Received: by 2002:adf:d1c3:: with SMTP id b3mr9982918wrd.231.1642507428205; Tue, 18 Jan 2022 04:03:48 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , David Hildenbrand , Paolo Bonzini , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 16/19] hw/dma: Move ScatterGatherEntry / QEMUSGList declarations around Date: Tue, 18 Jan 2022 13:02:26 +0100 Message-Id: <20220118120229.196337-17-f4bug@amsat.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118120229.196337-1-f4bug@amsat.org> References: <20220118120229.196337-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1642507433163100001 In the next commit we will use the dma_addr_t type in the QEMUSGList structure. Since currently dma_addr_t is defined after QEMUSGList, move the declarations to have dma_addr_t defined first. This is a pure code-movement patch. Suggested-by: David Hildenbrand Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: David Hildenbrand Message-Id: <20220111184309.28637-10-f4bug@amsat.org> --- include/sysemu/dma.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 0db2478a506..c992d9d5d6b 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -15,22 +15,11 @@ #include "block/block.h" #include "block/accounting.h" =20 -typedef struct ScatterGatherEntry ScatterGatherEntry; - typedef enum { DMA_DIRECTION_TO_DEVICE =3D 0, DMA_DIRECTION_FROM_DEVICE =3D 1, } DMADirection; =20 -struct QEMUSGList { - ScatterGatherEntry *sg; - int nsg; - int nalloc; - size_t size; - DeviceState *dev; - AddressSpace *as; -}; - /* * When an IOMMU is present, bus addresses become distinct from * CPU/memory physical addresses and may be a different size. Because @@ -43,6 +32,17 @@ typedef uint64_t dma_addr_t; #define DMA_ADDR_BITS 64 #define DMA_ADDR_FMT "%" PRIx64 =20 +typedef struct ScatterGatherEntry ScatterGatherEntry; + +struct QEMUSGList { + ScatterGatherEntry *sg; + int nsg; + int nalloc; + size_t size; + DeviceState *dev; + AddressSpace *as; +}; + static inline void dma_barrier(AddressSpace *as, DMADirection dir) { /* --=20 2.34.1