linux/arch/powerpc/kernel/dbell.c
<<
>>
Prefs
   1/*
   2 * Author: Kumar Gala <galak@kernel.crashing.org>
   3 *
   4 * Copyright 2009 Freescale Semiconductor Inc.
   5 *
   6 * This program is free software; you can redistribute  it and/or modify it
   7 * under  the terms of  the GNU General  Public License as published by the
   8 * Free Software Foundation;  either version 2 of the  License, or (at your
   9 * option) any later version.
  10 */
  11
  12#include <linux/stddef.h>
  13#include <linux/kernel.h>
  14#include <linux/smp.h>
  15#include <linux/threads.h>
  16#include <linux/hardirq.h>
  17
  18#include <asm/dbell.h>
  19#include <asm/irq_regs.h>
  20#include <asm/kvm_ppc.h>
  21
  22#ifdef CONFIG_SMP
  23
  24void doorbell_exception(struct pt_regs *regs)
  25{
  26        struct pt_regs *old_regs = set_irq_regs(regs);
  27
  28        irq_enter();
  29
  30        ppc_msgsync();
  31
  32        may_hard_irq_enable();
  33
  34        kvmppc_clear_host_ipi(smp_processor_id());
  35        __this_cpu_inc(irq_stat.doorbell_irqs);
  36
  37        smp_ipi_demux_relaxed(); /* already performed the barrier */
  38
  39        irq_exit();
  40        set_irq_regs(old_regs);
  41}
  42#else /* CONFIG_SMP */
  43void doorbell_exception(struct pt_regs *regs)
  44{
  45        printk(KERN_WARNING "Received doorbell on non-smp system\n");
  46}
  47#endif /* CONFIG_SMP */
  48
  49