1 /* 2 * VFIO helpers 3 * 4 * Copyright Red Hat, Inc. 2025 5 * 6 * SPDX-License-Identifier: GPL-2.0-or-later 7 */ 8 9 #ifndef HW_VFIO_VFIO_HELPERS_H 10 #define HW_VFIO_VFIO_HELPERS_H 11 12 #ifdef CONFIG_LINUX 13 #include <linux/vfio.h> 14 15 struct vfio_info_cap_header * 16 vfio_get_cap(void *ptr, uint32_t cap_offset, uint16_t id); 17 struct vfio_info_cap_header * 18 vfio_get_device_info_cap(struct vfio_device_info *info, uint16_t id); 19 struct vfio_info_cap_header * 20 vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id); 21 22 #endif 23 24 int vfio_bitmap_alloc(VFIOBitmap *vbmap, hwaddr size); 25 26 #endif /* HW_VFIO_VFIO_HELPERS_H */ 27