diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-17 10:44:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-17 10:44:25 +0300 |
commit | 0e9e37d042b1fc506287fceb939a35c35d610bf4 (patch) | |
tree | 5a87a8d81f3d44fec237efb6120216c199b15eae /include/xen/arm/swiotlb-xen.h | |
parent | 5c3e241f5246445da29bd03783ca61a18face968 (diff) | |
parent | d07f6ca923ea0927a1024dfccafc5b53b61cfecc (diff) | |
download | linux-0e9e37d042b1fc506287fceb939a35c35d610bf4.tar.xz |
Merge 5.13-rc2 into driver-core-next
We need the driver core fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/xen/arm/swiotlb-xen.h')
-rw-r--r-- | include/xen/arm/swiotlb-xen.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/xen/arm/swiotlb-xen.h b/include/xen/arm/swiotlb-xen.h index 2994fe6031a0..33336ab58afc 100644 --- a/include/xen/arm/swiotlb-xen.h +++ b/include/xen/arm/swiotlb-xen.h @@ -2,6 +2,19 @@ #ifndef _ASM_ARM_SWIOTLB_XEN_H #define _ASM_ARM_SWIOTLB_XEN_H -extern int xen_swiotlb_detect(void); +#include <xen/features.h> +#include <xen/xen.h> + +static inline int xen_swiotlb_detect(void) +{ + if (!xen_domain()) + return 0; + if (xen_feature(XENFEAT_direct_mapped)) + return 1; + /* legacy case */ + if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain()) + return 1; + return 0; +} #endif /* _ASM_ARM_SWIOTLB_XEN_H */ |