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