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