26 #include <linux/types.h>
27 #include <linux/export.h>
29 #include <asm/irq_regs.h>
30 #include <asm/machdep.h>
44 #define WRITE_WO_MMIO(reg, x) \
47 struct cbe_pmd_regs __iomem *pmd_regs; \
48 struct cbe_pmd_shadow_regs *shadow_regs; \
49 pmd_regs = cbe_get_cpu_pmd_regs(cpu); \
50 shadow_regs = cbe_get_cpu_pmd_shadow_regs(cpu); \
51 out_be64(&(pmd_regs->reg), (((u64)_x) << 32)); \
52 shadow_regs->reg = _x; \
55 #define READ_SHADOW_REG(val, reg) \
57 struct cbe_pmd_shadow_regs *shadow_regs; \
58 shadow_regs = cbe_get_cpu_pmd_shadow_regs(cpu); \
59 (val) = shadow_regs->reg; \
62 #define READ_MMIO_UPPER32(val, reg) \
64 struct cbe_pmd_regs __iomem *pmd_regs; \
65 pmd_regs = cbe_get_cpu_pmd_regs(cpu); \
66 (val) = (u32)(in_be64(&pmd_regs->reg) >> 32); \
82 if (val_in_latch & (1 << phys_ctr)) {
134 val = (ctr < NR_PHYS_CTRS) ? (val >> 16) : (val & 0xffff);
151 val = (val << 16) | (phys_val & 0xffff);
153 val = (val & 0xffff) | (phys_val & 0xffff0000);
380 static int __init cbe_init_pm_irq(
void)
387 (node << IIC_IRQ_NODE_SHIFT));
389 printk(
"ERROR: Unable to allocate irq for node %d\n",
395 0,
"cbe-pmu-0",
NULL);
397 printk(
"ERROR: Request for irq on node %d failed\n",
413 | (node << IIC_IRQ_NODE_SHIFT));
417 "for node %d\n", irq, node);