Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_ARM_SWIOTLB_XEN_H
0003 #define _ASM_ARM_SWIOTLB_XEN_H
0004 
0005 #include <xen/features.h>
0006 #include <xen/xen.h>
0007 
0008 static inline int xen_swiotlb_detect(void)
0009 {
0010     if (!xen_domain())
0011         return 0;
0012     if (xen_feature(XENFEAT_direct_mapped))
0013         return 1;
0014     /* legacy case */
0015     if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain())
0016         return 1;
0017     return 0;
0018 }
0019 
0020 #endif /* _ASM_ARM_SWIOTLB_XEN_H */