Age | Commit message (Collapse) | Author | Files | Lines |
|
In case of bitfields compiler may use data type to allocate struct size
and add additional paddings. Instead use data type which is closest to
the total size of the bitfields.
This patch also uses uint* version consistently throughout.
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
|
|
the static size assert for the PMCS register was checking the wrong struct;
however, the struct was nonetheless 4 bytes long, due to uint bitfields. This
accidentally meant the containing struct pmcap was the correct size (the
alignment attribute makes no difference).
After fixing struct pmcs, we'll include the additional two bytes defined in the
PCI PM specification, Section 3.2. These are "optional", but as elsewhere, we'll
require them when adding the capability.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
The PCI vendor-specific capability is blindly read/written by the
library. It is possible that the user might want to intercept accesses
to it, in which case we'll have to add callback. The best way to do this
to introduce a new function that configures callbacks for the PCI
capabilities, e.g.
typedef ssize_t (vfu_cap_access_t) (void *pvt, uint8_t id,
char *buf, size_t count, loff_t offset, bool is_write);
vfu_pci_cap_set_cb(vfu_ctx-T *vfu_ctx, uint8_t cap_id,
vfu_cap_access_t *cb);
This way the existing API won't have to change.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
The muser name no longer reflects the implementation, and will just serve to
confuse. Bite the bullet now, and rename ourselves to reflect the actual
implementation.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
Introduce include/ dir for public headers, and clean up include guards etc.
|