1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2022-2023, Advanced Micro Devices, Inc. 4 */ 5 6 #ifndef VFIO_CDX_PRIVATE_H 7 #define VFIO_CDX_PRIVATE_H 8 9 #define VFIO_CDX_OFFSET_SHIFT 40 10 11 static inline u64 vfio_cdx_index_to_offset(u32 index) 12 { 13 return ((u64)(index) << VFIO_CDX_OFFSET_SHIFT); 14 } 15 16 struct vfio_cdx_region { 17 u32 flags; 18 u32 type; 19 u64 addr; 20 resource_size_t size; 21 }; 22 23 struct vfio_cdx_device { 24 struct vfio_device vdev; 25 struct vfio_cdx_region *regions; 26 u32 flags; 27 #define BME_SUPPORT BIT(0) 28 }; 29 30 #endif /* VFIO_CDX_PRIVATE_H */ 31