swiotlb-xen.h 431 B

1234567891011121314151617181920
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_ARM_SWIOTLB_XEN_H
  3. #define _ASM_ARM_SWIOTLB_XEN_H
  4. #include <xen/features.h>
  5. #include <xen/xen.h>
  6. static inline int xen_swiotlb_detect(void)
  7. {
  8. if (!xen_domain())
  9. return 0;
  10. if (xen_feature(XENFEAT_direct_mapped))
  11. return 1;
  12. /* legacy case */
  13. if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain())
  14. return 1;
  15. return 0;
  16. }
  17. #endif /* _ASM_ARM_SWIOTLB_XEN_H */