abort-ev6.S 1.4 KB
Newer Older
L
Linus Torvalds 已提交
1 2
#include <linux/linkage.h>
#include <asm/assembler.h>
3
#include "abort-macro.S"
L
Linus Torvalds 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * Function: v6_early_abort
 *
 * Params  : r2 = address of aborted instruction
 *         : r3 = saved SPSR
 *
 * Returns : r0 = address of abort
 *	   : r1 = FSR, bit 11 = write
 *	   : r2-r8 = corrupted
 *	   : r9 = preserved
 *	   : sp = pointer to registers
 *
 * Purpose : obtain information about current aborted instruction.
17 18 19
 * Note: we read user space.  This means we might cause a data
 * abort here if the I-TLB and D-TLB aren't seeing the same
 * picture.  Unfortunately, this does happen.  We live with it.
L
Linus Torvalds 已提交
20 21 22
 */
	.align	5
ENTRY(v6_early_abort)
23
#ifdef CONFIG_CPU_V6
24 25
	sub	r1, sp, #4			@ Get unused stack location
	strex	r0, r1, [r1]			@ Clear the exclusive monitor
26 27
#elif defined(CONFIG_CPU_32v6K)
	clrex
28
#endif
L
Linus Torvalds 已提交
29 30
	mrc	p15, 0, r1, c5, c0, 0		@ get FSR
	mrc	p15, 0, r0, c6, c0, 0		@ get FAR
31
/*
32
 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103).
33 34
 * The test below covers all the write situations, including Java bytecodes
 */
35
	bic	r1, r1, #1 << 11		@ clear bit 11 of FSR
36 37
	tst	r3, #PSR_J_BIT			@ Java?
	movne	pc, lr
38
	do_thumb_abort fsr=r1, pc=r2, psr=r3, tmp=r3
39
	ldreq	r3, [r2]			@ read aborted ARM instruction
40 41 42
#ifdef CONFIG_CPU_ENDIAN_BE8
	reveq	r3, r3
#endif
43
	do_ldrd_abort tmp=r2, insn=r3
44 45
	tst	r3, #1 << 20			@ L = 0 -> write
	orreq	r1, r1, #1 << 11		@ yes.
L
Linus Torvalds 已提交
46 47 48
	mov	pc, lr