iova_bitmap.h 771 B

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