From ddd86436f4e3643c04b797f858dab95d5f2e4de9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Dec 2015 15:00:15 +0000 Subject: fish --- backport-include/asm-generic/bug.h | 39 +++++++++++++++++++++++++++ backport-include/asm-generic/pci-dma-compat.h | 17 ++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 backport-include/asm-generic/bug.h create mode 100644 backport-include/asm-generic/pci-dma-compat.h (limited to 'backport-include/asm-generic') diff --git a/backport-include/asm-generic/bug.h b/backport-include/asm-generic/bug.h new file mode 100644 index 0000000..4e9e05f --- /dev/null +++ b/backport-include/asm-generic/bug.h @@ -0,0 +1,39 @@ +#ifndef __BACKPORT_ASM_GENERIC_BUG_H +#define __BACKPORT_ASM_GENERIC_BUG_H +#include_next + +#ifndef __WARN +#define __WARN(foo) dump_stack() +#endif + +#ifndef WARN_ONCE +#define WARN_ONCE(condition, format...) ({ \ + static int __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once)) \ + if (WARN(!__warned, format)) \ + __warned = 1; \ + unlikely(__ret_warn_once); \ +}) +#endif + +#ifndef __WARN_printf +/* + * To port this properly we'd have to port warn_slowpath_null(), + * which I'm lazy to do so just do a regular print for now. If you + * want to port this read kernel/panic.c + */ +#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0) +#endif + +#ifndef WARN +#define WARN(condition, format...) ({ \ + int __ret_warn_on = !!(condition); \ + if (unlikely(__ret_warn_on)) \ + __WARN_printf(format); \ + unlikely(__ret_warn_on); \ +}) +#endif + +#endif /* __BACKPORT_ASM_GENERIC_BUG_H */ diff --git a/backport-include/asm-generic/pci-dma-compat.h b/backport-include/asm-generic/pci-dma-compat.h new file mode 100644 index 0000000..aa61f4d --- /dev/null +++ b/backport-include/asm-generic/pci-dma-compat.h @@ -0,0 +1,17 @@ +#ifndef __BACKPORT_ASM_PCI_DMA_COMPAT_H +#define __BACKPORT_ASM_PCI_DMA_COMPAT_H +#include_next +#include + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) +#include + +#define pci_dma_mapping_error1(dma_addr) dma_mapping_error1(dma_addr) +#define pci_dma_mapping_error2(pdev, dma_addr) dma_mapping_error2(pdev, dma_addr) +#undef pci_dma_mapping_error +#define pci_dma_mapping_error(...) \ + macro_dispatcher(pci_dma_mapping_error, __VA_ARGS__)(__VA_ARGS__) +#endif + +#endif /* __BACKPORT_ASM_PCI_DMA_COMPAT_H */ -- cgit v1.2.3