abort-ev7.S 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <linux/linkage.h>
  2. #include <asm/assembler.h>
  3. /*
  4. * Function: v7_early_abort
  5. *
  6. * Params : r2 = pt_regs
  7. * : r4 = aborted context pc
  8. * : r5 = aborted context psr
  9. *
  10. * Returns : r4 - r11, r13 preserved
  11. *
  12. * Purpose : obtain information about current aborted instruction.
  13. */
  14. .align 5
  15. ENTRY(v7_early_abort)
  16. mrc p15, 0, r1, c5, c0, 0 @ get FSR
  17. mrc p15, 0, r0, c6, c0, 0 @ get FAR
  18. uaccess_disable ip @ disable userspace access
  19. /*
  20. * V6 code adjusts the returned DFSR.
  21. * New designs should not need to patch up faults.
  22. */
  23. #if defined(CONFIG_VERIFY_PERMISSION_FAULT)
  24. /*
  25. * Detect erroneous permission failures and fix
  26. */
  27. ldr r3, =0x40d @ On permission fault
  28. and r3, r1, r3
  29. cmp r3, #0x0d
  30. bne do_DataAbort
  31. mcr p15, 0, r0, c7, c8, 0 @ Retranslate FAR
  32. isb
  33. mrc p15, 0, ip, c7, c4, 0 @ Read the PAR
  34. and r3, ip, #0x7b @ On translation fault
  35. cmp r3, #0x0b
  36. bne do_DataAbort
  37. bic r1, r1, #0xf @ Fix up FSR FS[5:0]
  38. and ip, ip, #0x7e
  39. orr r1, r1, ip, LSR #1
  40. #endif
  41. b do_DataAbort
  42. ENDPROC(v7_early_abort)