diff options
Diffstat (limited to 'arch/mn10300/include/asm/barrier.h')
-rw-r--r-- | arch/mn10300/include/asm/barrier.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/mn10300/include/asm/barrier.h b/arch/mn10300/include/asm/barrier.h new file mode 100644 index 000000000000..2bd97a5c8af7 --- /dev/null +++ b/arch/mn10300/include/asm/barrier.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* MN10300 memory barrier definitions | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #ifndef _ASM_BARRIER_H | ||
12 | #define _ASM_BARRIER_H | ||
13 | |||
14 | #define nop() asm volatile ("nop") | ||
15 | |||
16 | #define mb() asm volatile ("": : :"memory") | ||
17 | #define rmb() mb() | ||
18 | #define wmb() asm volatile ("": : :"memory") | ||
19 | |||
20 | #ifdef CONFIG_SMP | ||
21 | #define smp_mb() mb() | ||
22 | #define smp_rmb() rmb() | ||
23 | #define smp_wmb() wmb() | ||
24 | #define set_mb(var, value) do { xchg(&var, value); } while (0) | ||
25 | #else /* CONFIG_SMP */ | ||
26 | #define smp_mb() barrier() | ||
27 | #define smp_rmb() barrier() | ||
28 | #define smp_wmb() barrier() | ||
29 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
30 | #endif /* CONFIG_SMP */ | ||
31 | |||
32 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
33 | |||
34 | #define read_barrier_depends() do {} while (0) | ||
35 | #define smp_read_barrier_depends() do {} while (0) | ||
36 | |||
37 | #endif /* _ASM_BARRIER_H */ | ||