mca_drv_asm.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * File: mca_drv_asm.S
  4. * Purpose: Assembly portion of Generic MCA handling
  5. *
  6. * Copyright (C) 2004 FUJITSU LIMITED
  7. * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
  8. */
  9. #include <linux/threads.h>
  10. #include <asm/asmmacro.h>
  11. #include <asm/processor.h>
  12. #include <asm/ptrace.h>
  13. GLOBAL_ENTRY(mca_handler_bhhook)
  14. invala // clear RSE ?
  15. cover
  16. ;;
  17. clrrrb
  18. ;;
  19. alloc r16=ar.pfs,0,2,3,0 // make a new frame
  20. mov ar.rsc=0
  21. mov r13=IA64_KR(CURRENT) // current task pointer
  22. ;;
  23. mov r2=r13
  24. ;;
  25. addl r22=IA64_RBS_OFFSET,r2
  26. ;;
  27. mov ar.bspstore=r22
  28. addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
  29. ;;
  30. adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
  31. ;;
  32. st1 [r2]=r0 // clear current->thread.on_ustack flag
  33. mov loc0=r16
  34. movl loc1=mca_handler_bh // recovery C function
  35. ;;
  36. mov out0=r8 // poisoned address
  37. mov out1=r9 // iip
  38. mov out2=r10 // psr
  39. mov b6=loc1
  40. ;;
  41. mov loc1=rp
  42. ssm psr.ic
  43. ;;
  44. srlz.i
  45. ;;
  46. ssm psr.i
  47. br.call.sptk.many rp=b6 // does not return ...
  48. ;;
  49. mov ar.pfs=loc0
  50. mov rp=loc1
  51. ;;
  52. mov r8=r0
  53. br.ret.sptk.many rp
  54. END(mca_handler_bhhook)