Skip to content

Commit cb6f6b3

Browse files
Stefano Stabellinijgross1
authored andcommitted
xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
Move xen_swiotlb_detect to a static inline function to make it available to !CONFIG_XEN builds. CC: [email protected] CC: [email protected] Signed-off-by: Stefano Stabellini <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent dbc03e8 commit cb6f6b3

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

arch/arm/xen/mm.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,6 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order)
135135
return;
136136
}
137137

138-
int xen_swiotlb_detect(void)
139-
{
140-
if (!xen_domain())
141-
return 0;
142-
if (xen_feature(XENFEAT_direct_mapped))
143-
return 1;
144-
/* legacy case */
145-
if (!xen_feature(XENFEAT_not_direct_mapped) && xen_initial_domain())
146-
return 1;
147-
return 0;
148-
}
149-
150138
static int __init xen_mm_init(void)
151139
{
152140
struct gnttab_cache_flush cflush;

include/xen/arm/swiotlb-xen.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
#ifndef _ASM_ARM_SWIOTLB_XEN_H
33
#define _ASM_ARM_SWIOTLB_XEN_H
44

5-
extern int xen_swiotlb_detect(void);
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+
}
619

720
#endif /* _ASM_ARM_SWIOTLB_XEN_H */

0 commit comments

Comments
 (0)