Skip to content

Commit

Permalink
openrisc: Define memory barrier mb
Browse files Browse the repository at this point in the history
[ Upstream commit 8b549c1 ]

This came up in the discussion of the requirements of qspinlock on an
architecture.  OpenRISC uses qspinlock, but it was noticed that the
memmory barrier was not defined.

Peter defined it in the mail thread writing:

    As near as I can tell this should do. The arch spec only lists
    this one instruction and the text makes it sound like a completion
    barrier.

This is correct so applying this patch.

Signed-off-by: Peter Zijlstra <[email protected]>
[[email protected]:Turned the mail into a patch]
Signed-off-by: Stafford Horne <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Peter Zijlstra authored and gregkh committed Jun 3, 2021
1 parent 038dc33 commit ffe3b37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/openrisc/include/asm/barrier.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_BARRIER_H
#define __ASM_BARRIER_H

#define mb() asm volatile ("l.msync" ::: "memory")

#include <asm-generic/barrier.h>

#endif /* __ASM_BARRIER_H */

0 comments on commit ffe3b37

Please sign in to comment.