1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2022, Oracle and/or its affiliates.
4 * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved
6 #ifndef _IOVA_BITMAP_H_
7 #define _IOVA_BITMAP_H_
9 #include <linux/types.h>
13 typedef int (*iova_bitmap_fn_t)(struct iova_bitmap *bitmap,
14 unsigned long iova, size_t length,
17 struct iova_bitmap *iova_bitmap_alloc(unsigned long iova, size_t length,
18 unsigned long page_size,
20 void iova_bitmap_free(struct iova_bitmap *bitmap);
21 int iova_bitmap_for_each(struct iova_bitmap *bitmap, void *opaque,
23 void iova_bitmap_set(struct iova_bitmap *bitmap,
24 unsigned long iova, size_t length);