Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
debug.c File Reference
#include <linux/cb710.h>
#include <linux/kernel.h>
#include <linux/module.h>

Go to the source code of this file.

Macros

#define CB710_REG_COUNT   0x80
 
#define CB710_READ_REGS_TEMPLATE(t)
 
#define CB710_DUMP_REGS_TEMPLATE(t)
 
#define CB710_READ_AND_DUMP_REGS_TEMPLATE(t)
 
#define CB710_REG_ACCESS_TEMPLATES(t)
 

Functions

void cb710_dump_regs (struct cb710_chip *chip, unsigned select)
 
 EXPORT_SYMBOL_GPL (cb710_dump_regs)
 

Macro Definition Documentation

#define CB710_DUMP_REGS_TEMPLATE (   t)
Value:
static void cb710_dump_regs_##t(struct device *dev, \
const u##t *reg, unsigned select) \
{ \
const char *const xp = &cb710_xes[8 - t/4]; \
const char *const format = cb710_regf_##t; \
\
char msg[100], *p; \
unsigned i, j; \
for (i = 0; i < ARRAY_SIZE(allow); ++i, reg += 16/(t/8)) { \
if (!(select & (1 << i))) \
continue; \
p = msg; \
for (j = 0; j < 0x10/(t/8); ++j) { \
*p++ = ' '; \
if (j == 8/(t/8)) \
*p++ = ' '; \
if (allow_reg_read(i, j, t)) \
p += sprintf(p, format, reg[j]); \
else \
p += sprintf(p, "%s", xp); \
} \
dev_dbg(dev, "%s 0x%02X %s\n", prefix[i], i << 4, msg); \
} \
}

Definition at line 56 of file debug.c.

#define CB710_READ_AND_DUMP_REGS_TEMPLATE (   t)
Value:
static void cb710_read_and_dump_regs_##t(struct cb710_chip *chip, \
unsigned select) \
{ \
u##t regs[CB710_REG_COUNT/sizeof(u##t)]; \
memset(&regs, 0, sizeof(regs)); \
cb710_read_regs_##t(chip->iobase, regs, select); \
cb710_dump_regs_##t(cb710_chip_dev(chip), regs, select); \
}

Definition at line 83 of file debug.c.

#define CB710_READ_REGS_TEMPLATE (   t)
Value:
static void cb710_read_regs_##t(void __iomem *iobase, \
u##t *reg, unsigned select) \
{ \
unsigned i, j; \
for (i = 0; i < ARRAY_SIZE(allow); ++i, reg += 16/(t/8)) { \
if (!(select & (1 << i))) \
continue; \
for (j = 0; j < 0x10/(t/8); ++j) { \
if (!allow_reg_read(i, j, t)) \
continue; \
reg[j] = ioread##t(iobase \
+ (i << 4) + (j * (t/8))); \
} \
} \
}

Definition at line 32 of file debug.c.

#define CB710_REG_ACCESS_TEMPLATES (   t)
Value:
CB710_DUMP_REGS_TEMPLATE(t) \
CB710_READ_AND_DUMP_REGS_TEMPLATE(t)

Definition at line 94 of file debug.c.

#define CB710_REG_COUNT   0x80

Definition at line 14 of file debug.c.

Function Documentation

void cb710_dump_regs ( struct cb710_chip chip,
unsigned  select 
)

Definition at line 103 of file debug.c.

EXPORT_SYMBOL_GPL ( cb710_dump_regs  )