qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Define PCI vendor and device ID in pci.h
Date: Sat, 24 Jan 2009 15:57:08 +0000	[thread overview]
Message-ID: <20090124155708.GA29561@miranda.arrow> (raw)
In-Reply-To: <4978A6BF.9030606@us.ibm.com>

On Thu, Jan 22, 2009 at 11:02:55AM -0600, Anthony Liguori wrote:
> >+    *(uint16_t *)&pci_conf[0x00] = cpu_to_le16(PCI_VENDOR_ID_INTEL);
> >+    *(uint16_t *)&pci_conf[0x02] = 
> >cpu_to_le16(PCI_DEVICE_ID_INTEL_82371SB_2);
> >  
> You should use cpu_to_le16uw here.

That was my initial thought -- only cpu_to_le16uw() still requires the
cast.  The EEPro100 emulation uses its own style:

    PCI_CONFIG_16(PCI_VENDOR_ID, 0x8086);
    PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209);

... but I didn't like this, because the name of 'pci_conf' is not
specified explicitly, and PCI_CONFIG_* are just little-endian writes,
and not anything particularly special.

> Even better yet, you should  introduce some PCI space accessors to
> remove all of the open coded offset access.

> You could start with just 
> pci_config_set_vendor_id()/pci_config_set_device_id().

That sounds much better!  Will do! :)

Cheers,
-- 
Stuart Brady

      reply	other threads:[~2009-01-24 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18 13:25 [Qemu-devel] [PATCH] Define PCI vendor and device ID in pci.h Stuart Brady
2009-01-22 17:02 ` Anthony Liguori
2009-01-24 15:57   ` Stuart Brady [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090124155708.GA29561@miranda.arrow \
    --to=sdbrady@ntlworld.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).