+/* 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
#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 */