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