Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[deliverable/linux.git] / arch / powerpc / kernel / dbell.c
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
21 #ifdef CONFIG_SMP
22 void doorbell_setup_this_cpu(void)
23 {
24 unsigned long tag = mfspr(SPRN_PIR) & 0x3fff;
25
26 smp_muxed_ipi_set_data(smp_processor_id(), tag);
27 }
28
29 void doorbell_cause_ipi(int cpu, unsigned long data)
30 {
31 ppc_msgsnd(PPC_DBELL, 0, data);
32 }
33
34 void doorbell_exception(struct pt_regs *regs)
35 {
36 struct pt_regs *old_regs = set_irq_regs(regs);
37
38 irq_enter();
39
40 may_hard_irq_enable();
41
42 smp_ipi_demux();
43
44 irq_exit();
45 set_irq_regs(old_regs);
46 }
47 #else /* CONFIG_SMP */
48 void doorbell_exception(struct pt_regs *regs)
49 {
50 printk(KERN_WARNING "Received doorbell on non-smp system\n");
51 }
52 #endif /* CONFIG_SMP */
53
This page took 0.031389 seconds and 5 git commands to generate.