helpers.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. .align 32
  3. .globl __flushw_user
  4. .type __flushw_user,#function
  5. __flushw_user:
  6. rdpr %otherwin, %g1
  7. brz,pn %g1, 2f
  8. clr %g2
  9. 1: save %sp, -128, %sp
  10. rdpr %otherwin, %g1
  11. brnz,pt %g1, 1b
  12. add %g2, 1, %g2
  13. 1: sub %g2, 1, %g2
  14. brnz,pt %g2, 1b
  15. restore %g0, %g0, %g0
  16. 2: retl
  17. nop
  18. .size __flushw_user,.-__flushw_user
  19. EXPORT_SYMBOL(__flushw_user)
  20. /* Flush %fp and %i7 to the stack for all register
  21. * windows active inside of the cpu. This allows
  22. * show_stack_trace() to avoid using an expensive
  23. * 'flushw'.
  24. */
  25. .globl stack_trace_flush
  26. .type stack_trace_flush,#function
  27. stack_trace_flush:
  28. rdpr %pstate, %o0
  29. wrpr %o0, PSTATE_IE, %pstate
  30. rdpr %cwp, %g1
  31. rdpr %canrestore, %g2
  32. sub %g1, 1, %g3
  33. 1: brz,pn %g2, 2f
  34. sub %g2, 1, %g2
  35. wrpr %g3, %cwp
  36. stx %fp, [%sp + STACK_BIAS + RW_V9_I6]
  37. stx %i7, [%sp + STACK_BIAS + RW_V9_I7]
  38. ba,pt %xcc, 1b
  39. sub %g3, 1, %g3
  40. 2: wrpr %g1, %cwp
  41. wrpr %o0, %pstate
  42. retl
  43. nop
  44. .size stack_trace_flush,.-stack_trace_flush
  45. #ifdef CONFIG_SMP
  46. .globl hard_smp_processor_id
  47. .type hard_smp_processor_id,#function
  48. hard_smp_processor_id:
  49. #endif
  50. .globl real_hard_smp_processor_id
  51. .type real_hard_smp_processor_id,#function
  52. real_hard_smp_processor_id:
  53. __GET_CPUID(%o0)
  54. retl
  55. nop
  56. #ifdef CONFIG_SMP
  57. .size hard_smp_processor_id,.-hard_smp_processor_id
  58. #endif
  59. .size real_hard_smp_processor_id,.-real_hard_smp_processor_id
  60. EXPORT_SYMBOL_GPL(real_hard_smp_processor_id)