Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
ehca_tools.h File Reference
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/idr.h>
#include <linux/kthread.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/vmalloc.h>
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/device.h>
#include <linux/atomic.h>
#include <asm/ibmebus.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/hvcall.h>

Go to the source code of this file.

Macros

#define ehca_dbg(ib_dev, format, arg...)
 
#define ehca_info(ib_dev, format, arg...)
 
#define ehca_warn(ib_dev, format, arg...)
 
#define ehca_err(ib_dev, format, arg...)
 
#define ehca_gen_dbg(format, arg...)
 
#define ehca_gen_warn(format, arg...)
 
#define ehca_gen_err(format, arg...)
 
#define ehca_dmp(adr, len, format, args...)
 
#define EHCA_BMASK(pos, length)   (((pos) << 16) + (length))
 
#define EHCA_BMASK_IBM(from, to)   (((63 - to) << 16) + ((to) - (from) + 1))
 
#define EHCA_BMASK_SHIFTPOS(mask)   (((mask) >> 16) & 0xffff)
 
#define EHCA_BMASK_MASK(mask)   (~0ULL >> ((64 - (mask)) & 0xffff))
 
#define EHCA_BMASK_SET(mask, value)   ((EHCA_BMASK_MASK(mask) & ((u64)(value))) << EHCA_BMASK_SHIFTPOS(mask))
 
#define EHCA_BMASK_GET(mask, value)   (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask)))
 

Functions

int ehca2ib_return_code (u64 ehca_rc)
 

Variables

int ehca_debug_level
 

Macro Definition Documentation

#define EHCA_BMASK (   pos,
  length 
)    (((pos) << 16) + (length))

Definition at line 126 of file ehca_tools.h.

#define EHCA_BMASK_GET (   mask,
  value 
)    (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask)))

EHCA_BMASK_GET - extract a parameter from value by mask

Definition at line 149 of file ehca_tools.h.

#define EHCA_BMASK_IBM (   from,
  to 
)    (((63 - to) << 16) + ((to) - (from) + 1))

Definition at line 129 of file ehca_tools.h.

#define EHCA_BMASK_MASK (   mask)    (~0ULL >> ((64 - (mask)) & 0xffff))

Definition at line 135 of file ehca_tools.h.

#define EHCA_BMASK_SET (   mask,
  value 
)    ((EHCA_BMASK_MASK(mask) & ((u64)(value))) << EHCA_BMASK_SHIFTPOS(mask))

EHCA_BMASK_SET - return value shifted and masked by mask variable|=EHCA_BMASK_SET(MY_MASK,0x4711) ORs the bits in variable variable&=~EHCA_BMASK_SET(MY_MASK,-1) clears the bits from the mask in variable

Definition at line 143 of file ehca_tools.h.

#define EHCA_BMASK_SHIFTPOS (   mask)    (((mask) >> 16) & 0xffff)

Definition at line 132 of file ehca_tools.h.

#define ehca_dbg (   ib_dev,
  format,
  arg... 
)
Value:
do { \
dev_printk(KERN_DEBUG, (ib_dev)->dma_device, \
"PU%04x EHCA_DBG:%s " format "\n", \
raw_smp_processor_id(), __func__, \
## arg); \
} while (0)

Definition at line 69 of file ehca_tools.h.

#define ehca_dmp (   adr,
  len,
  format,
  args... 
)
Value:
do { \
unsigned int x; \
unsigned int l = (unsigned int)(len); \
unsigned char *deb = (unsigned char *)(adr); \
for (x = 0; x < l; x += 16) { \
printk(KERN_INFO "EHCA_DMP:%s " format \
" adr=%p ofs=%04x %016llx %016llx\n", \
__func__, ##args, deb, x, \
*((u64 *)&deb[0]), *((u64 *)&deb[8])); \
deb += 16; \
} \
} while (0)

ehca_dmp - printk a memory block, whose length is n*8 bytes. Each line has the following layout: <format string>=""> adr=X ofs=Y <8 bytes hex> <8 bytes hex>

Definition at line 111 of file ehca_tools.h.

#define ehca_err (   ib_dev,
  format,
  arg... 
)
Value:
dev_err((ib_dev)->dma_device, "PU%04x EHCA_ERR:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg)

Definition at line 86 of file ehca_tools.h.

#define ehca_gen_dbg (   format,
  arg... 
)
Value:
do { \
printk(KERN_DEBUG "PU%04x EHCA_DBG:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg); \
} while (0)

Definition at line 91 of file ehca_tools.h.

#define ehca_gen_err (   format,
  arg... 
)
Value:
printk(KERN_ERR "PU%04x EHCA_ERR:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg)

Definition at line 102 of file ehca_tools.h.

#define ehca_gen_warn (   format,
  arg... 
)
Value:
printk(KERN_INFO "PU%04x EHCA_WARN:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg)

Definition at line 98 of file ehca_tools.h.

#define ehca_info (   ib_dev,
  format,
  arg... 
)
Value:
dev_info((ib_dev)->dma_device, "PU%04x EHCA_INFO:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg)

Definition at line 78 of file ehca_tools.h.

#define ehca_warn (   ib_dev,
  format,
  arg... 
)
Value:
dev_warn((ib_dev)->dma_device, "PU%04x EHCA_WARN:%s " format "\n", \
raw_smp_processor_id(), __func__, ## arg)

Definition at line 82 of file ehca_tools.h.

Function Documentation

int ehca2ib_return_code ( u64  ehca_rc)

Definition at line 149 of file ehca_main.c.

Variable Documentation

int ehca_debug_level

Definition at line 66 of file ehca_main.c.