From patchwork Fri Oct 30 12:20:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 37274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EA1B2B7C35 for ; Fri, 30 Oct 2009 23:30:01 +1100 (EST) Received: from localhost ([127.0.0.1]:48860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3qc9-0004fI-KY for incoming@patchwork.ozlabs.org; Fri, 30 Oct 2009 08:29:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3qVo-0001uM-9x for qemu-devel@nongnu.org; Fri, 30 Oct 2009 08:23:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3qVc-0001lk-9T for qemu-devel@nongnu.org; Fri, 30 Oct 2009 08:23:18 -0400 Received: from [199.232.76.173] (port=52337 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3qVc-0001lb-1e for qemu-devel@nongnu.org; Fri, 30 Oct 2009 08:23:12 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:34034) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3qVb-0002q2-Hs for qemu-devel@nongnu.org; Fri, 30 Oct 2009 08:23:11 -0400 Received: from nm.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with ESMTP id 759E218055; Fri, 30 Oct 2009 21:23:04 +0900 (JST) Received: from yamahata by nm.local.valinux.co.jp with local (Exim 4.69) (envelope-from ) id 1N3qTv-0006ct-Dz; Fri, 30 Oct 2009 21:21:27 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org, mst@redhat.com Date: Fri, 30 Oct 2009 21:20:59 +0900 Message-Id: <1256905286-25435-6-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1256905286-25435-1-git-send-email-yamahata@valinux.co.jp> References: <1256905286-25435-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V6 05/32] pci: helper functions to access PCIDevice::config X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org add helper functions to get/set PCIDevice::config Those will be used later. Signed-off-by: Isaku Yamahata Acked-by: Michael S. Tsirkin --- hw/pci.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/pci.h b/hw/pci.h index bab9cab..157995c 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -312,6 +312,18 @@ pci_get_long(uint8_t *config) } static inline void +pci_set_quad(uint8_t *config, uint64_t val) +{ + cpu_to_le64w((uint64_t *)config, val); +} + +static inline uint64_t +pci_get_quad(uint8_t *config) +{ + return le64_to_cpup((uint64_t *)config); +} + +static inline void pci_config_set_vendor_id(uint8_t *pci_config, uint16_t val) { pci_set_word(&pci_config[PCI_VENDOR_ID], val);