From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MuNjb-0006py-F9 for qemu-devel@nongnu.org; Sun, 04 Oct 2009 05:50:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MuNjV-0006o9-LW for qemu-devel@nongnu.org; Sun, 04 Oct 2009 05:50:29 -0400 Received: from [199.232.76.173] (port=33062 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuNjV-0006o4-FF for qemu-devel@nongnu.org; Sun, 04 Oct 2009 05:50:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15118) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MuNjU-0007u2-Vv for qemu-devel@nongnu.org; Sun, 04 Oct 2009 05:50:25 -0400 Date: Sun, 4 Oct 2009 11:48:23 +0200 From: "Michael S. Tsirkin" Message-ID: <20091004094823.GC16887@redhat.com> References: <1254514577-11896-1-git-send-email-yamahata@valinux.co.jp> <1254514577-11896-8-git-send-email-yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1254514577-11896-8-git-send-email-yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 07/25] pci: helper functions to access PCIDevice::config List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Sat, Oct 03, 2009 at 05:15:59AM +0900, Isaku Yamahata wrote: > 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 00c8947..e79540a 100644 > --- a/hw/pci.h > +++ b/hw/pci.h > @@ -310,6 +310,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); > -- > 1.6.0.2 > >