History

virtio_pci: better macro exported in uapi

Macro VIRTIO_PCI_CONFIG assumes that userspace actually has a structure with a field named msix_enabled. Add VIRTIO_PCI_CONFIG_OFF that gets the msix_enabled by value instead, to make it useful for userspace. We still keep VIRTIO_PCI_CONFIG around for now, in case some userspace uses it.

Michael S. Tsirkin committed 13 years ago

Commit 8b21ab11 parent d5fe85a1 file · +3 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/virtio_pci.h+3−1
@@ -80,7 +80,9 @@ · 79 unmodified lines
80 80
81/* The remaining space is defined by each driver as the per-driver81/* The remaining space is defined by each driver as the per-driver
82 * configuration space */82 * configuration space */
83#define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20)83#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20)
84/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
85#define VIRTIO_PCI_CONFIG(dev) VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
84 86
85/* Virtio ABI version, this must match exactly */87/* Virtio ABI version, this must match exactly */
86#define VIRTIO_PCI_ABI_VERSION 088#define VIRTIO_PCI_ABI_VERSION 0

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t