0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/linkage.h>
0009 #include <asm/asm-offsets.h>
0010 #include <asm/nospec-insn.h>
0011 #include <asm/sigp.h>
0012
0013 GEN_BR_THUNK %r9
0014
0015 #
0016 # Issue "store status" for the current CPU to its prefix page
0017 # and call passed function afterwards
0018 #
0019 # r2 = Function to be called after store status
0020 # r3 = Parameter for function
0021 #
0022 ENTRY(store_status)
0023
0024 stg %r1,__LC_SAVE_AREA_RESTART
0025
0026 lghi %r1,__LC_GPREGS_SAVE_AREA
0027 stmg %r0,%r15,0(%r1)
0028 mvc 8(8,%r1),__LC_SAVE_AREA_RESTART
0029
0030 lghi %r1,__LC_CREGS_SAVE_AREA
0031 stctg %c0,%c15,0(%r1)
0032
0033 lghi %r1,__LC_AREGS_SAVE_AREA
0034 stam %a0,%a15,0(%r1)
0035
0036 lghi %r1,__LC_FPREGS_SAVE_AREA
0037 std %f0, 0x00(%r1)
0038 std %f1, 0x08(%r1)
0039 std %f2, 0x10(%r1)
0040 std %f3, 0x18(%r1)
0041 std %f4, 0x20(%r1)
0042 std %f5, 0x28(%r1)
0043 std %f6, 0x30(%r1)
0044 std %f7, 0x38(%r1)
0045 std %f8, 0x40(%r1)
0046 std %f9, 0x48(%r1)
0047 std %f10,0x50(%r1)
0048 std %f11,0x58(%r1)
0049 std %f12,0x60(%r1)
0050 std %f13,0x68(%r1)
0051 std %f14,0x70(%r1)
0052 std %f15,0x78(%r1)
0053
0054 lghi %r1,__LC_FP_CREG_SAVE_AREA
0055 stfpc 0(%r1)
0056
0057 lghi %r1,__LC_CPU_TIMER_SAVE_AREA
0058 stpt 0(%r1)
0059
0060 lghi %r1,__LC_PREFIX_SAVE_AREA
0061 stpx 0(%r1)
0062
0063 lghi %r1,__LC_CLOCK_COMP_SAVE_AREA
0064 larl %r4,.Lclkcmp
0065 stckc 0(%r4)
0066 mvc 1(7,%r1),1(%r4)
0067
0068 lghi %r1,__LC_PSW_SAVE_AREA
0069 epsw %r4,%r5
0070 st %r4,0(%r1)
0071 st %r5,4(%r1)
0072 stg %r2,8(%r1)
0073 lgr %r9,%r2
0074 lgr %r2,%r3
0075 BR_EX %r9
0076 ENDPROC(store_status)
0077
0078 .section .bss
0079 .align 8
0080 .Lclkcmp: .quad 0x0000000000000000
0081 .previous