Re: [Qemu-devel] [PATCH] pci: add accessors to get/set registers by mask

2012-02-22 Thread Anthony Liguori
On 02/21/2012 07:41 AM, Michael S. Tsirkin wrote: pci_regs.h specifies many registers by mask + shifted register values. There's always some duplication when using such: for example to override device type, we would need: pci_word_test_and_clear_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE

Re: [Qemu-devel] [PATCH] pci: add accessors to get/set registers by mask

2012-02-22 Thread Isaku Yamahata
sounds good idea and the patch Looks good. On Tue, Feb 21, 2012 at 03:41:30PM +0200, Michael S. Tsirkin wrote: > pci_regs.h specifies many registers by mask + > shifted register values. > There's always some duplication when using such: > for example to override device type, we would need: > > pc

[Qemu-devel] [PATCH] pci: add accessors to get/set registers by mask

2012-02-21 Thread Michael S. Tsirkin
pci_regs.h specifies many registers by mask + shifted register values. There's always some duplication when using such: for example to override device type, we would need: pci_word_test_and_clear_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE); pci_word_test_and_set_mask(cap + PCI_EXP_FLAGS,