diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irq.c | 6 | ||||
-rw-r--r-- | lib/migration.c | 23 | ||||
-rw-r--r-- | lib/migration.h | 2 | ||||
-rw-r--r-- | lib/migration_priv.h | 8 |
4 files changed, 18 insertions, 21 deletions
@@ -162,7 +162,7 @@ static int irqs_set_data_none(vfu_ctx_t *vfu_ctx, struct vfio_irq_set *irq_set) { int efd; - __u32 i; + uint32_t i; long ret; eventfd_t val; @@ -187,7 +187,7 @@ irqs_set_data_bool(vfu_ctx_t *vfu_ctx, struct vfio_irq_set *irq_set, void *data) { uint8_t *d8; int efd; - __u32 i; + uint32_t i; long ret; eventfd_t val; @@ -214,7 +214,7 @@ irqs_set_data_eventfd(vfu_ctx_t *vfu_ctx, struct vfio_irq_set *irq_set, int *data) { int efd; - __u32 i; + uint32_t i; size_t j; assert(data != NULL); diff --git a/lib/migration.c b/lib/migration.c index 93703a0..ff6913b 100644 --- a/lib/migration.c +++ b/lib/migration.c @@ -39,11 +39,8 @@ #include "private.h" #include "migration_priv.h" -/* FIXME no need to use __u32 etc., use uint32_t etc */ - - bool -vfio_migr_state_transition_is_valid(__u32 from, __u32 to) +vfio_migr_state_transition_is_valid(uint32_t from, uint32_t to) { return migr_states[from].state & (1 << to); } @@ -111,7 +108,7 @@ migr_state_transition(struct migration *migr, enum migr_iter_state state) static ssize_t handle_device_state(vfu_ctx_t *vfu_ctx, struct migration *migr, - __u32 *device_state, bool is_write) { + uint32_t *device_state, bool is_write) { int ret; @@ -178,7 +175,7 @@ handle_device_state(vfu_ctx_t *vfu_ctx, struct migration *migr, static ssize_t handle_pending_bytes(vfu_ctx_t *vfu_ctx, struct migration *migr, - __u64 *pending_bytes, bool is_write) + uint64_t *pending_bytes, bool is_write) { assert(migr != NULL); assert(pending_bytes != NULL); @@ -273,7 +270,7 @@ handle_data_offset_when_saving(vfu_ctx_t *vfu_ctx, struct migration *migr, static ssize_t handle_data_offset(vfu_ctx_t *vfu_ctx, struct migration *migr, - __u64 *offset, bool is_write) + uint64_t *offset, bool is_write) { int ret; @@ -331,7 +328,7 @@ handle_data_size_when_saving(vfu_ctx_t *vfu_ctx, struct migration *migr, static ssize_t handle_data_size_when_resuming(vfu_ctx_t *vfu_ctx, struct migration *migr, - __u64 size, bool is_write) + uint64_t size, bool is_write) { assert(migr != NULL); @@ -343,7 +340,7 @@ handle_data_size_when_resuming(vfu_ctx_t *vfu_ctx, struct migration *migr, static ssize_t handle_data_size(vfu_ctx_t *vfu_ctx, struct migration *migr, - __u64 *size, bool is_write) + uint64_t *size, bool is_write) { int ret; @@ -382,7 +379,7 @@ migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count, "bad device_state access size %ld", count); return -EINVAL; } - ret = handle_device_state(vfu_ctx, migr, (__u32*)buf, is_write); + ret = handle_device_state(vfu_ctx, migr, (uint32_t *)buf, is_write); break; case offsetof(struct vfio_device_migration_info, pending_bytes): if (count != sizeof(migr->info.pending_bytes)) { @@ -390,7 +387,7 @@ migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count, "bad pending_bytes access size %ld", count); return -EINVAL; } - ret = handle_pending_bytes(vfu_ctx, migr, (__u64*)buf, is_write); + ret = handle_pending_bytes(vfu_ctx, migr, (uint64_t *)buf, is_write); break; case offsetof(struct vfio_device_migration_info, data_offset): if (count != sizeof(migr->info.data_offset)) { @@ -398,7 +395,7 @@ migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count, "bad data_offset access size %ld", count); return -EINVAL; } - ret = handle_data_offset(vfu_ctx, migr, (__u64*)buf, is_write); + ret = handle_data_offset(vfu_ctx, migr, (uint64_t *)buf, is_write); break; case offsetof(struct vfio_device_migration_info, data_size): if (count != sizeof(migr->info.data_size)) { @@ -406,7 +403,7 @@ migration_region_access_registers(vfu_ctx_t *vfu_ctx, char *buf, size_t count, "bad data_size access size %ld", count); return -EINVAL; } - ret = handle_data_size(vfu_ctx, migr, (__u64*)buf, is_write); + ret = handle_data_size(vfu_ctx, migr, (uint64_t *)buf, is_write); break; default: vfu_log(vfu_ctx, LOG_ERR, "bad migration region register offset %#lx", diff --git a/lib/migration.h b/lib/migration.h index 498cae0..aeaca66 100644 --- a/lib/migration.h +++ b/lib/migration.h @@ -66,7 +66,7 @@ int migration_set_pgsize(struct migration *migr, size_t pgsize); bool -vfio_migr_state_transition_is_valid(__u32 from, __u32 to); +vfio_migr_state_transition_is_valid(uint32_t from, uint32_t to); #endif /* LIB_VFIO_USER_MIGRATION_H */ diff --git a/lib/migration_priv.h b/lib/migration_priv.h index b8a8734..bf47621 100644 --- a/lib/migration_priv.h +++ b/lib/migration_priv.h @@ -59,14 +59,14 @@ struct migration { */ struct { enum migr_iter_state state; - __u64 pending_bytes; - __u64 offset; - __u64 size; + uint64_t pending_bytes; + uint64_t offset; + uint64_t size; } iter; }; struct migr_state_data { - __u32 state; + uint32_t state; const char *name; }; |