Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LoongArch64] Fix nonvolatile context restoration referenced 101709. #101904

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/pal/src/arch/loongarch64/asmconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#define CONTEXT_T6 CONTEXT_T5+SIZEOF_LOONGARCH_GPR
#define CONTEXT_T7 CONTEXT_T6+SIZEOF_LOONGARCH_GPR
#define CONTEXT_T8 CONTEXT_T7+SIZEOF_LOONGARCH_GPR
#define CONTEXT_X0 CONTEXT_T8+SIZEOF_LOONGARCH_GPR
#define CONTEXT_Fp CONTEXT_X0+SIZEOF_LOONGARCH_GPR
#define CONTEXT_R21 CONTEXT_T8+SIZEOF_LOONGARCH_GPR
#define CONTEXT_Fp CONTEXT_R21+SIZEOF_LOONGARCH_GPR
shushanhf marked this conversation as resolved.
Show resolved Hide resolved
#define CONTEXT_S0 CONTEXT_Fp+SIZEOF_LOONGARCH_GPR
#define CONTEXT_S1 CONTEXT_S0+SIZEOF_LOONGARCH_GPR
#define CONTEXT_S2 CONTEXT_S1+SIZEOF_LOONGARCH_GPR
Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/pal/src/arch/loongarch64/context2.S
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ LOCAL_LABEL(No_Restore_CONTEXT_INTEGER):

ld.d $ra, $t4, CONTEXT_Ra
ld.d $fp, $t4, CONTEXT_Fp
ld.d $sp, $t4, CONTEXT_Sp
ld.d $r21, $t4, CONTEXT_Pc
ld.d $t4, $t4, CONTEXT_T4
ld.d $sp, $t4, CONTEXT_Sp
// NOTE: the r21 and t4 had been trashed.
jirl $r0, $r21, 0


LOCAL_LABEL(No_Restore_CONTEXT_CONTROL):
ld.d $r21, $t4, CONTEXT_R21
ld.d $t4, $t4, CONTEXT_T4
jirl $r0, $ra, 0
LEAF_END RtlRestoreContext, _TEXT
Expand Down Expand Up @@ -202,7 +203,7 @@ LOCAL_LABEL(Done_CONTEXT_CONTROL):
st.d $t6, $a0, CONTEXT_T6
st.d $t7, $a0, CONTEXT_T7
st.d $t8, $a0, CONTEXT_T8
st.d $r21,$a0, CONTEXT_X0
st.d $r21,$a0, CONTEXT_R21
st.d $s0, $a0, CONTEXT_S0
st.d $s1, $a0, CONTEXT_S1
st.d $s2, $a0, CONTEXT_S2
Expand Down
Loading