1 /*
2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #include "hi_osal.h"
20 #include <linux/module.h>
21 #include <linux/kernel.h>
22 #include <asm/barrier.h>
23
osal_mb(void)24 void osal_mb(void)
25 {
26 mb();
27 }
28 EXPORT_SYMBOL(osal_mb);
osal_rmb(void)29 void osal_rmb(void)
30 {
31 rmb();
32 }
33 EXPORT_SYMBOL(osal_rmb);
osal_wmb(void)34 void osal_wmb(void)
35 {
36 wmb();
37 }
38 EXPORT_SYMBOL(osal_wmb);
osal_smp_mb(void)39 void osal_smp_mb(void)
40 {
41 smp_mb();
42 }
43 EXPORT_SYMBOL(osal_smp_mb);
osal_smp_rmb(void)44 void osal_smp_rmb(void)
45 {
46 smp_rmb();
47 }
48 EXPORT_SYMBOL(osal_smp_rmb);
osal_smp_wmb(void)49 void osal_smp_wmb(void)
50 {
51 smp_wmb();
52 }
53 EXPORT_SYMBOL(osal_smp_wmb);
osal_isb(void)54 void osal_isb(void)
55 {
56 isb();
57 }
58 EXPORT_SYMBOL(osal_isb);
osal_dsb(void)59 void osal_dsb(void)
60 {
61 #ifdef CONFIG_64BIT
62 dsb(sy);
63 #else
64 dsb();
65 #endif
66 }
67 EXPORT_SYMBOL(osal_dsb);
osal_dmb(void)68 void osal_dmb(void)
69 {
70 #ifdef CONFIG_64BIT
71 dmb(sy);
72 #else
73 dmb();
74 #endif
75 }
76 EXPORT_SYMBOL(osal_dmb);
77