xref: /kernel/linux/linux-5.10/arch/mips/mm/cex-gen.S (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 1995 - 1999 Ralf Baechle
78c2ecf20Sopenharmony_ci * Copyright (C) 1999 Silicon Graphics, Inc.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Cache error handler
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#include <asm/asm.h>
128c2ecf20Sopenharmony_ci#include <asm/regdef.h>
138c2ecf20Sopenharmony_ci#include <asm/mipsregs.h>
148c2ecf20Sopenharmony_ci#include <asm/stackframe.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/*
178c2ecf20Sopenharmony_ci * Game over.  Go to the button.  Press gently.	 Swear where allowed by
188c2ecf20Sopenharmony_ci * legislation.
198c2ecf20Sopenharmony_ci */
208c2ecf20Sopenharmony_ci	LEAF(except_vec2_generic)
218c2ecf20Sopenharmony_ci	.set	noreorder
228c2ecf20Sopenharmony_ci	.set	noat
238c2ecf20Sopenharmony_ci	.set	mips0
248c2ecf20Sopenharmony_ci	/*
258c2ecf20Sopenharmony_ci	 * This is a very bad place to be.  Our cache error
268c2ecf20Sopenharmony_ci	 * detection has triggered.  If we have write-back data
278c2ecf20Sopenharmony_ci	 * in the cache, we may not be able to recover.	 As a
288c2ecf20Sopenharmony_ci	 * first-order desperate measure, turn off KSEG0 cacheing.
298c2ecf20Sopenharmony_ci	 */
308c2ecf20Sopenharmony_ci	mfc0	k0,CP0_CONFIG
318c2ecf20Sopenharmony_ci	li	k1,~CONF_CM_CMASK
328c2ecf20Sopenharmony_ci	and	k0,k0,k1
338c2ecf20Sopenharmony_ci	ori	k0,k0,CONF_CM_UNCACHED
348c2ecf20Sopenharmony_ci	mtc0	k0,CP0_CONFIG
358c2ecf20Sopenharmony_ci	/* Give it a few cycles to sink in... */
368c2ecf20Sopenharmony_ci	nop
378c2ecf20Sopenharmony_ci	nop
388c2ecf20Sopenharmony_ci	nop
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	j	cache_parity_error
418c2ecf20Sopenharmony_ci	nop
428c2ecf20Sopenharmony_ci	END(except_vec2_generic)
43