powerpc: Introduce msgsnd/doorbell barrier primitives

POWER9 changes requirements and adds new instructions for
synchronization.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Nicholas Piggin
2017-04-13 20:16:22 +10:00
committed by Michael Ellerman
parent b866cc2199
commit b87ac02183
4 changed files with 36 additions and 5 deletions

View File

@@ -44,6 +44,17 @@ static inline void _ppc_msgsnd(u32 msg)
__asm__ __volatile__ (PPC_MSGSNDP(%0) : : "r" (msg));
}
/* sync before sending message */
static inline void ppc_msgsnd_sync(void)
{
__asm__ __volatile__ ("sync" : : : "memory");
}
/* sync after taking message interrupt */
static inline void ppc_msgsync(void)
{
}
#else /* CONFIG_PPC_BOOK3S */
#define PPC_DBELL_MSGTYPE PPC_DBELL
@@ -53,6 +64,17 @@ static inline void _ppc_msgsnd(u32 msg)
__asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
}
/* sync before sending message */
static inline void ppc_msgsnd_sync(void)
{
__asm__ __volatile__ ("sync" : : : "memory");
}
/* sync after taking message interrupt */
static inline void ppc_msgsync(void)
{
}
#endif /* CONFIG_PPC_BOOK3S */
extern void doorbell_global_ipi(int cpu);