2 * linux/arch/arm/mm/abort-ev0t.S
4 * Copyright (C) 2004 Tobias Lorenz
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
13 * Function: v0t_early_abort
15 * Params : r2 = address of aborted instruction
18 * Returns : r0 = address of abort
19 * : r1 = FSR, bit 11 = write
22 * : sp = pointer to registers
24 * Purpose : obtain information about current aborted instruction.
25 * Note: we read user space. This means we might cause a data
26 * abort here if the I-TLB and D-TLB aren't seeing the same
27 * picture. Unfortunately, this does happen. We live with it.
30 ENTRY(v0t_early_abort)
32 ldrneh r3, [r2] @ read aborted thumb instruction
33 ldreq r3, [r2] @ read aborted ARM instruction
34 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR
35 movne r3, r3, lsl #(21 - 12) @ move thumb bit 11 to ARM bit 20
36 tst r3, #1 << 20 @ check write
37 orreq r1, r1, #1 << 11