1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _ASM_ARM_SWIOTLB_XEN_H 2 #ifndef _ASM_ARM_SWIOTLB_XEN_H 3 #define _ASM_ARM_SWIOTLB_XEN_H 3 #define _ASM_ARM_SWIOTLB_XEN_H 4 4 5 #include <xen/features.h> 5 #include <xen/features.h> 6 #include <xen/xen.h> 6 #include <xen/xen.h> 7 7 8 static inline int xen_swiotlb_detect(void) 8 static inline int xen_swiotlb_detect(void) 9 { 9 { 10 if (!xen_domain()) 10 if (!xen_domain()) 11 return 0; 11 return 0; 12 if (xen_feature(XENFEAT_direct_mapped) 12 if (xen_feature(XENFEAT_direct_mapped)) 13 return 1; 13 return 1; 14 /* legacy case */ 14 /* legacy case */ 15 if (!xen_feature(XENFEAT_not_direct_ma 15 if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) 16 return 1; 16 return 1; 17 return 0; 17 return 0; 18 } 18 } 19 19 20 #endif /* _ASM_ARM_SWIOTLB_XEN_H */ 20 #endif /* _ASM_ARM_SWIOTLB_XEN_H */ 21 21
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.