[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Define PCI vendor and device ID in pci.h
From: |
Stuart Brady |
Subject: |
Re: [Qemu-devel] [PATCH] Define PCI vendor and device ID in pci.h |
Date: |
Sat, 24 Jan 2009 15:57:08 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
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