mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 05:32:47 +00:00
Fix clobbered registers on MRC/MCR/MRS/MSR C wrappers
Previously the compiler could've optimized stores/reads to be placed outside of critical sections, etc
This commit is contained in:
parent
a6734af45d
commit
08b53f71e1
@ -75,19 +75,19 @@
|
|||||||
|
|
||||||
#define ARM_MCR(cp, op1, reg, crn, crm, op2) asm_v( \
|
#define ARM_MCR(cp, op1, reg, crn, crm, op2) asm_v( \
|
||||||
"MCR " #cp ", " #op1 ", %[R], " #crn ", " #crm ", " #op2 "\n\t" \
|
"MCR " #cp ", " #op1 ", %[R], " #crn ", " #crm ", " #op2 "\n\t" \
|
||||||
:: [R] "r"(reg))
|
:: [R] "r"(reg) : "memory","cc")
|
||||||
|
|
||||||
#define ARM_MRC(cp, op1, reg, crn, crm, op2) asm_v( \
|
#define ARM_MRC(cp, op1, reg, crn, crm, op2) asm_v( \
|
||||||
"MRC " #cp ", " #op1 ", %[R], " #crn ", " #crm ", " #op2 "\n\t" \
|
"MRC " #cp ", " #op1 ", %[R], " #crn ", " #crm ", " #op2 "\n\t" \
|
||||||
: [R] "=r"(reg))
|
: [R] "=r"(reg) :: "memory","cc")
|
||||||
|
|
||||||
#define ARM_MSR(cp, reg) asm_v( \
|
#define ARM_MSR(cp, reg) asm_v( \
|
||||||
"MSR " #cp ", %[R]\n\t" \
|
"MSR " #cp ", %[R]\n\t" \
|
||||||
:: [R] "r"(reg))
|
:: [R] "r"(reg) : "memory","cc")
|
||||||
|
|
||||||
#define ARM_MRS(reg, cp) asm_v( \
|
#define ARM_MRS(reg, cp) asm_v( \
|
||||||
"MRS %[R], " #cp "\n\t" \
|
"MRS %[R], " #cp "\n\t" \
|
||||||
: [R] "=r"(reg))
|
: [R] "=r"(reg) :: "memory","cc")
|
||||||
|
|
||||||
#ifdef ARM11
|
#ifdef ARM11
|
||||||
#define ARM_CPS(m) asm_v("CPS " #m)
|
#define ARM_CPS(m) asm_v("CPS " #m)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user