18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * arch/arm/mach-iop32x/include/mach/entry-macro.S
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Low-level IRQ helper macros for IOP32x-based platforms
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
78c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any
88c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci	.macro get_irqnr_preamble, base, tmp
118c2ecf20Sopenharmony_ci	mrc	p15, 0, \tmp, c15, c1, 0
128c2ecf20Sopenharmony_ci	orr	\tmp, \tmp, #(1 << 6)
138c2ecf20Sopenharmony_ci	mcr	p15, 0, \tmp, c15, c1, 0	@ Enable cp6 access
148c2ecf20Sopenharmony_ci	mrc	p15, 0, \tmp, c15, c1, 0
158c2ecf20Sopenharmony_ci	mov	\tmp, \tmp
168c2ecf20Sopenharmony_ci	sub	pc, pc, #4			@ cp_wait
178c2ecf20Sopenharmony_ci	.endm
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci	.macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
208c2ecf20Sopenharmony_ci	mrc     p6, 0, \irqstat, c8, c0, 0	@ Read IINTSRC
218c2ecf20Sopenharmony_ci	cmp     \irqstat, #0
228c2ecf20Sopenharmony_ci	clzne   \irqnr, \irqstat
238c2ecf20Sopenharmony_ci	rsbne   \irqnr, \irqnr, #32
248c2ecf20Sopenharmony_ci	.endm
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci	.macro arch_ret_to_user, tmp1, tmp2
278c2ecf20Sopenharmony_ci	mrc	p15, 0, \tmp1, c15, c1, 0
288c2ecf20Sopenharmony_ci	ands	\tmp2, \tmp1, #(1 << 6)
298c2ecf20Sopenharmony_ci	bicne	\tmp1, \tmp1, #(1 << 6)
308c2ecf20Sopenharmony_ci	mcrne	p15, 0, \tmp1, c15, c1, 0	@ Disable cp6 access
318c2ecf20Sopenharmony_ci	.endm
32