1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-11 23:17:39 +01:00

UC_MCONTEXT_FPREGS_PTR is made optional

This commit is contained in:
Alexander Esilevich 2010-07-30 22:22:49 +07:00
parent 42a6f57c19
commit ee32be6651
2 changed files with 7 additions and 0 deletions

View file

@ -58,7 +58,9 @@ _Ux86_64_getcontext:
/* Save fp state (not needed, except for setcontext not /* Save fp state (not needed, except for setcontext not
restoring garbage). */ restoring garbage). */
leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8 leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8
#ifdef UC_MCONTEXT_FPREGS_PTR
movq %r8, UC_MCONTEXT_FPREGS_PTR(%rdi) movq %r8, UC_MCONTEXT_FPREGS_PTR(%rdi)
#endif // UC_MCONTEXT_FPREGS_PTR
fnstenv (%r8) fnstenv (%r8)
stmxcsr FPREGS_OFFSET_MXCSR(%r8) stmxcsr FPREGS_OFFSET_MXCSR(%r8)

View file

@ -37,7 +37,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
_Ux86_64_setcontext: _Ux86_64_setcontext:
/* restore fp state */ /* restore fp state */
// TODO: why not just use leaq?
#ifdef UC_MCONTEXT_FPREGS_PTR
mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8 mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8
#else // UC_MCONTEXT_FPREGS_PTR
leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8
#endif // UC_MCONTEXT_FPREGS_PTR
fldenv (%r8) fldenv (%r8)
ldmxcsr FPREGS_OFFSET_MXCSR(%r8) ldmxcsr FPREGS_OFFSET_MXCSR(%r8)