Go to the documentation of this file.
47 #include <linux/kernel.h>
53 #include <linux/mman.h>
54 #include <linux/module.h>
59 #include <linux/device.h>
64 #include <asm/pgtable.h>
69 #define ehca_dbg(ib_dev, format, arg...) \
71 if (unlikely(ehca_debug_level)) \
72 dev_printk(KERN_DEBUG, (ib_dev)->dma_device, \
73 "PU%04x EHCA_DBG:%s " format "\n", \
74 raw_smp_processor_id(), __func__, \
78 #define ehca_info(ib_dev, format, arg...) \
79 dev_info((ib_dev)->dma_device, "PU%04x EHCA_INFO:%s " format "\n", \
80 raw_smp_processor_id(), __func__, ## arg)
82 #define ehca_warn(ib_dev, format, arg...) \
83 dev_warn((ib_dev)->dma_device, "PU%04x EHCA_WARN:%s " format "\n", \
84 raw_smp_processor_id(), __func__, ## arg)
86 #define ehca_err(ib_dev, format, arg...) \
87 dev_err((ib_dev)->dma_device, "PU%04x EHCA_ERR:%s " format "\n", \
88 raw_smp_processor_id(), __func__, ## arg)
91 #define ehca_gen_dbg(format, arg...) \
93 if (unlikely(ehca_debug_level)) \
94 printk(KERN_DEBUG "PU%04x EHCA_DBG:%s " format "\n", \
95 raw_smp_processor_id(), __func__, ## arg); \
98 #define ehca_gen_warn(format, arg...) \
99 printk(KERN_INFO "PU%04x EHCA_WARN:%s " format "\n", \
100 raw_smp_processor_id(), __func__, ## arg)
102 #define ehca_gen_err(format, arg...) \
103 printk(KERN_ERR "PU%04x EHCA_ERR:%s " format "\n", \
104 raw_smp_processor_id(), __func__, ## arg)
111 #define ehca_dmp(adr, len, format, args...) \
114 unsigned int l = (unsigned int)(len); \
115 unsigned char *deb = (unsigned char *)(adr); \
116 for (x = 0; x < l; x += 16) { \
117 printk(KERN_INFO "EHCA_DMP:%s " format \
118 " adr=%p ofs=%04x %016llx %016llx\n", \
119 __func__, ##args, deb, x, \
120 *((u64 *)&deb[0]), *((u64 *)&deb[8])); \
126 #define EHCA_BMASK(pos, length) (((pos) << 16) + (length))
129 #define EHCA_BMASK_IBM(from, to) (((63 - to) << 16) + ((to) - (from) + 1))
132 #define EHCA_BMASK_SHIFTPOS(mask) (((mask) >> 16) & 0xffff)
135 #define EHCA_BMASK_MASK(mask) (~0ULL >> ((64 - (mask)) & 0xffff))
143 #define EHCA_BMASK_SET(mask, value) \
144 ((EHCA_BMASK_MASK(mask) & ((u64)(value))) << EHCA_BMASK_SHIFTPOS(mask))
149 #define EHCA_BMASK_GET(mask, value) \
150 (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask)))