2008-10-23 12:26:29 +07:00
|
|
|
#ifndef _ASM_X86_SWIOTLB_H
|
|
|
|
#define _ASM_X86_SWIOTLB_H
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2008-12-28 13:02:05 +07:00
|
|
|
#include <linux/swiotlb.h>
|
2006-01-12 04:44:42 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifdef CONFIG_SWIOTLB
|
|
|
|
extern int swiotlb;
|
2010-08-27 00:57:59 +07:00
|
|
|
extern int __init pci_swiotlb_detect_override(void);
|
|
|
|
extern int __init pci_swiotlb_detect_4gb(void);
|
2009-12-15 18:47:56 +07:00
|
|
|
extern void __init pci_swiotlb_init(void);
|
2010-08-27 00:57:59 +07:00
|
|
|
extern void __init pci_swiotlb_late_init(void);
|
2005-04-17 05:20:36 +07:00
|
|
|
#else
|
|
|
|
#define swiotlb 0
|
2010-08-27 00:57:59 +07:00
|
|
|
static inline int pci_swiotlb_detect_override(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int pci_swiotlb_detect_4gb(void)
|
2008-07-11 08:23:45 +07:00
|
|
|
{
|
2009-11-11 22:03:28 +07:00
|
|
|
return 0;
|
2008-07-11 08:23:45 +07:00
|
|
|
}
|
2009-12-15 18:47:56 +07:00
|
|
|
static inline void pci_swiotlb_init(void)
|
|
|
|
{
|
|
|
|
}
|
2010-08-27 00:57:59 +07:00
|
|
|
static inline void pci_swiotlb_late_init(void)
|
|
|
|
{
|
|
|
|
}
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif
|
|
|
|
|
2007-02-06 09:46:40 +07:00
|
|
|
static inline void dma_mark_clean(void *addr, size_t size) {}
|
|
|
|
|
2014-06-05 06:06:50 +07:00
|
|
|
extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
|
|
|
|
dma_addr_t *dma_handle, gfp_t flags,
|
2016-08-04 03:46:00 +07:00
|
|
|
unsigned long attrs);
|
2014-06-05 06:06:50 +07:00
|
|
|
extern void x86_swiotlb_free_coherent(struct device *dev, size_t size,
|
|
|
|
void *vaddr, dma_addr_t dma_addr,
|
2016-08-04 03:46:00 +07:00
|
|
|
unsigned long attrs);
|
2014-06-05 06:06:50 +07:00
|
|
|
|
2008-10-23 12:26:29 +07:00
|
|
|
#endif /* _ASM_X86_SWIOTLB_H */
|