]> git.sur5r.net Git - u-boot/blobdiff - arch/mips/include/asm/system.h
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / mips / include / asm / system.h
index d56f73b8b8e108f0e1ccf322905089fa9f4eed0f..79e638844b21e04a87e451a4fa36462afc5b18de 100644 (file)
@@ -1,8 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
  * Copyright (C) 1994 - 1999 by Ralf Baechle
  * Copyright (C) 1996 by Paul M. Antoine
  * Copyright (C) 1994 - 1999 by Ralf Baechle
 #ifndef _ASM_SYSTEM_H
 #define _ASM_SYSTEM_H
 
+#include <asm/asm.h>
 #include <asm/sgidefs.h>
 #include <asm/ptrace.h>
+#include <linux/stringify.h>
 #if 0
 #include <linux/kernel.h>
 #endif
@@ -264,4 +263,23 @@ extern void __die_if_kernel(const char *, struct pt_regs *, const char *where,
 #define die_if_kernel(msg, regs)                                       \
        __die_if_kernel(msg, regs, __FILE__ ":"__FUNCTION__, __LINE__)
 
+static inline void execution_hazard_barrier(void)
+{
+       __asm__ __volatile__(
+               ".set noreorder\n"
+               "ehb\n"
+               ".set reorder");
+}
+
+static inline void instruction_hazard_barrier(void)
+{
+       unsigned long tmp;
+
+       asm volatile(
+       __stringify(PTR_LA) "\t%0, 1f\n"
+       "       jr.hb   %0\n"
+       "1:     .insn"
+       : "=&r"(tmp));
+}
+
 #endif /* _ASM_SYSTEM_H */