From patchwork Wed Jun 15 12:21:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Kiarie X-Patchwork-Id: 9178463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 04B276021C for ; Wed, 15 Jun 2016 12:23:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E99A827BF7 for ; Wed, 15 Jun 2016 12:23:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC5F527D4A; Wed, 15 Jun 2016 12:23:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DB5727BF7 for ; Wed, 15 Jun 2016 12:23:20 +0000 (UTC) Received: from localhost ([::1]:41827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD9qo-0003DE-SY for patchwork-qemu-devel@patchwork.kernel.org; Wed, 15 Jun 2016 08:23:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD9pw-00025G-K7 for qemu-devel@nongnu.org; Wed, 15 Jun 2016 08:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD9pm-0004E0-IB for qemu-devel@nongnu.org; Wed, 15 Jun 2016 08:22:23 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD9pm-0004Dw-Bi for qemu-devel@nongnu.org; Wed, 15 Jun 2016 08:22:14 -0400 Received: by mail-wm0-x242.google.com with SMTP id r5so5591049wmr.0 for ; Wed, 15 Jun 2016 05:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qGjibiMXEYNd+Gg0wKvT761q1SEIcSD4fzME5VbNSkY=; b=bMRF6aCPd99Ai+uZ+d3x0pgb/BYP43v6yu26bHEr9R0JOYPtAMktLlXXmvFDcB3OiY NP0F8Gy81kIPF13huiwwK6i1Io0a4v6Bkn8izry/eIpK/uDr1zcxbrPPtcvoyPZKxLW5 4Sf7ZbdYLc59Lqa/zzMIoP+jiorAjBnwEyxtwoD9CpMoaB5fwSSdxMce6mK+v2vqFfC7 K23sRg8l3boHj1vL6a11BXD5Jg6LvDHH5XApapfGyNxa9XSmnVacV0xB2m6FD0MiyxXj U3dBI8XMiA+d+VljnjLfEg7iKrhXAhBrDk9oJ3PMqq+VvrqtTHoYANTUv4xsz12um14u y4SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qGjibiMXEYNd+Gg0wKvT761q1SEIcSD4fzME5VbNSkY=; b=lNRi99LX8lX3B2CYhKLq+iGv0s63neg4eTbzW9eTXegg04G9Uq2r/95e48CQy9XXiU l6Cs4I4omE7uIvTeJh9hpHwrpgshBShT/Q5azcff0mZ0HRqNLD97tn45qwXBIwTZWYRd 5zb5W9GfWeTI7NCeu367fHgneqNZlwcRTm4VxR8SBEQJvY6szjGtfr1Kx0bXfR64MEzx 9CgOQIEYClHOYLe1fRA7U3O24kK6HnQkXCFiza1eWbFwfqRcbBT/Y3ZnGVCjgzF4ERX1 9MLmjJ5A5I/tiV5VnLah/r+4WzIXO+mzIutJ8G0Q/HM9Lf8CyBJKtaDanHxV87mE7wEC FQ7w== X-Gm-Message-State: ALyK8tL4ovl3Vbaf3LopPSZkcxj/UXBQmLmZnGwoTH26C4SwePxpRg7DU7451wu2ERKnJg== X-Received: by 10.194.89.138 with SMTP id bo10mr11184234wjb.122.1465993333615; Wed, 15 Jun 2016 05:22:13 -0700 (PDT) Received: from debian.flybox.orange ([154.122.146.192]) by smtp.googlemail.com with ESMTPSA id s67sm3107339wmf.3.2016.06.15.05.22.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Jun 2016 05:22:13 -0700 (PDT) From: David Kiarie To: qemu-devel@nongnu.org Date: Wed, 15 Jun 2016 15:21:49 +0300 Message-Id: <1465993312-18119-2-git-send-email-davidkiarie4@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465993312-18119-1-git-send-email-davidkiarie4@gmail.com> References: <1465993312-18119-1-git-send-email-davidkiarie4@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [V12 1/4] hw/pci: Prepare for AMD IOMMU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, valentine.sinitsyn@gmail.com, peterx@redhat.com, alex.williamson@redhat.com, jan.kiszka@web.de, marcel@redhat.com, David Kiarie Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce PCI macros from linux headers for use by AMD IOMMU Signed-off-by: David Kiarie --- include/hw/pci/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 4420f47..ac376c5 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -12,6 +12,8 @@ /* PCI bus */ +#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) +#define PCI_DEVID(bus, devfn) ((((uint16_t)(bus)) << 8) | (devfn)) #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07)