This source file includes following definitions.
- _ppc_msgsnd
- ppc_msgsnd_sync
- ppc_msgsync
- _ppc_msgclr
- ppc_msgclr
- _ppc_msgsnd
- ppc_msgsnd_sync
- ppc_msgsync
- ppc_msgsnd
1
2
3
4
5
6
7
8 #ifndef _ASM_POWERPC_DBELL_H
9 #define _ASM_POWERPC_DBELL_H
10
11 #include <linux/smp.h>
12 #include <linux/threads.h>
13
14 #include <asm/ppc-opcode.h>
15 #include <asm/feature-fixups.h>
16
17 #define PPC_DBELL_MSG_BRDCAST (0x04000000)
18 #define PPC_DBELL_TYPE(x) (((x) & 0xf) << (63-36))
19 #define PPC_DBELL_TYPE_MASK PPC_DBELL_TYPE(0xf)
20 #define PPC_DBELL_LPID(x) ((x) << (63 - 49))
21 #define PPC_DBELL_PIR_MASK 0x3fff
22 enum ppc_dbell {
23 PPC_DBELL = 0,
24 PPC_DBELL_CRIT = 1,
25 PPC_G_DBELL = 2,
26 PPC_G_DBELL_CRIT = 3,
27 PPC_G_DBELL_MC = 4,
28 PPC_DBELL_SERVER = 5,
29 };
30
31 #ifdef CONFIG_PPC_BOOK3S
32
33 #define PPC_DBELL_MSGTYPE PPC_DBELL_SERVER
34
35 static inline void _ppc_msgsnd(u32 msg)
36 {
37 __asm__ __volatile__ (ASM_FTR_IFSET(PPC_MSGSND(%1), PPC_MSGSNDP(%1), %0)
38 : : "i" (CPU_FTR_HVMODE), "r" (msg));
39 }
40
41
42 static inline void ppc_msgsnd_sync(void)
43 {
44 __asm__ __volatile__ ("sync" : : : "memory");
45 }
46
47
48 static inline void ppc_msgsync(void)
49 {
50
51 __asm__ __volatile__ (ASM_FTR_IFSET(PPC_MSGSYNC " ; lwsync", "", %0)
52 : : "i" (CPU_FTR_HVMODE|CPU_FTR_ARCH_300));
53 }
54
55 static inline void _ppc_msgclr(u32 msg)
56 {
57 __asm__ __volatile__ (ASM_FTR_IFSET(PPC_MSGCLR(%1), PPC_MSGCLRP(%1), %0)
58 : : "i" (CPU_FTR_HVMODE), "r" (msg));
59 }
60
61 static inline void ppc_msgclr(enum ppc_dbell type)
62 {
63 u32 msg = PPC_DBELL_TYPE(type);
64
65 _ppc_msgclr(msg);
66 }
67
68 #else
69
70 #define PPC_DBELL_MSGTYPE PPC_DBELL
71
72 static inline void _ppc_msgsnd(u32 msg)
73 {
74 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
75 }
76
77
78 static inline void ppc_msgsnd_sync(void)
79 {
80 __asm__ __volatile__ ("sync" : : : "memory");
81 }
82
83
84 static inline void ppc_msgsync(void)
85 {
86 }
87
88 #endif
89
90 extern void doorbell_global_ipi(int cpu);
91 extern void doorbell_core_ipi(int cpu);
92 extern int doorbell_try_core_ipi(int cpu);
93 extern void doorbell_exception(struct pt_regs *regs);
94
95 static inline void ppc_msgsnd(enum ppc_dbell type, u32 flags, u32 tag)
96 {
97 u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
98 (tag & 0x07ffffff);
99
100 _ppc_msgsnd(msg);
101 }
102
103 #endif