diff options
author | Adeel <adeelbm@outlook.com> | 2019-05-25 14:00:00 +0300 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2019-06-12 09:00:40 -0700 |
commit | edc427a9eccd6db583fd0cd920e2af23b4b544a9 (patch) | |
tree | 06c88d139c0d7c950b56f89d645f80ab492fbe09 /src/x86_64 | |
parent | 434e9095cbaaa74a99d13dd5bab4db071b999be4 (diff) | |
download | libunwind-edc427a9eccd6db583fd0cd920e2af23b4b544a9.tar.gz |
Add initial support for Solaris x86-64
Diffstat (limited to 'src/x86_64')
-rw-r--r-- | src/x86_64/Gos-solaris.c | 16 | ||||
-rw-r--r-- | src/x86_64/getcontext.S | 2 | ||||
-rw-r--r-- | src/x86_64/setcontext.S | 17 | ||||
-rw-r--r-- | src/x86_64/ucontext_i.h | 4 |
4 files changed, 12 insertions, 27 deletions
diff --git a/src/x86_64/Gos-solaris.c b/src/x86_64/Gos-solaris.c index 6e764463..10e15230 100644 --- a/src/x86_64/Gos-solaris.c +++ b/src/x86_64/Gos-solaris.c @@ -47,21 +47,21 @@ tdep_fetch_frame (struct dwarf_cursor *dw, unw_word_t ip, int need_unwind_info) dw->ip, dw->cfa, c->sigcontext_format); } -HIDDEN void -tdep_cache_frame (struct dwarf_cursor *dw, struct dwarf_reg_state *rs) +HIDDEN int +tdep_cache_frame (struct dwarf_cursor *dw) { struct cursor *c = (struct cursor *) dw; - rs->signal_frame = c->sigcontext_format; Debug(5, "cache frame ip=0x%lx cfa=0x%lx format=%d\n", dw->ip, dw->cfa, c->sigcontext_format); + return c->sigcontext_format; } HIDDEN void -tdep_reuse_frame (struct dwarf_cursor *dw, struct dwarf_reg_state *rs) +tdep_reuse_frame (struct dwarf_cursor *dw, int frame) { struct cursor *c = (struct cursor *) dw; - c->sigcontext_format = rs->signal_frame; + c->sigcontext_format = frame; if (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME) { c->frame_info.frame_type = UNW_X86_64_FRAME_SIGRETURN; @@ -78,15 +78,15 @@ tdep_reuse_frame (struct dwarf_cursor *dw, struct dwarf_reg_state *rs) ? c->frame_info.cfa_reg_offset : 0)); } -PROTECTED int +int unw_is_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; return c->sigcontext_format != X86_64_SCF_NONE; } -PROTECTED int -unw_handle_signal_frame (unw_cursor_t *cursor) +HIDDEN int +x86_64_handle_signal_frame (unw_cursor_t *cursor) { #if UNW_DEBUG /* To silence compiler warnings */ /* Should not get here because we now use kernel-provided dwarf diff --git a/src/x86_64/getcontext.S b/src/x86_64/getcontext.S index 6f5d0a14..e1450719 100644 --- a/src/x86_64/getcontext.S +++ b/src/x86_64/getcontext.S @@ -57,7 +57,7 @@ _Ux86_64_getcontext: movq %rax, UC_MCONTEXT_GREGS_RAX(%rdi) movq %rcx, UC_MCONTEXT_GREGS_RCX(%rdi) -#if defined(__linux__) || defined(__sun__) +#if defined __linux__ || defined __sun /* Save fp state (not needed, except for setcontext not restoring garbage). */ leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8 diff --git a/src/x86_64/setcontext.S b/src/x86_64/setcontext.S index 4cbefe08..17e5ae12 100644 --- a/src/x86_64/setcontext.S +++ b/src/x86_64/setcontext.S @@ -37,22 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ _Ux86_64_setcontext: -#if defined(__linux__) || defined(__sun__) - /* restore signal mask - sigprocmask(SIG_SETMASK, ucp->uc_sigmask, NULL, sizeof(sigset_t)) */ - push %rdi -#if defined(__sun__) - mov $SYS_sigprocmask, %rax -#else - mov $__NR_rt_sigprocmask, %rax -#endif - lea UC_SIGMASK(%rdi), %rsi - mov $SIG_SETMASK, %rdi - xor %rdx, %rdx - mov $SIGSET_BYTE_SIZE, %r10 - syscall - pop %rdi - +#if defined __linux__ || defined __sun /* restore fp state */ #ifdef UC_MCONTEXT_FPREGS_PTR mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8 diff --git a/src/x86_64/ucontext_i.h b/src/x86_64/ucontext_i.h index e41e5629..e886c948 100644 --- a/src/x86_64/ucontext_i.h +++ b/src/x86_64/ucontext_i.h @@ -78,7 +78,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define UC_MCONTEXT_FPOWNED_FPU 0x20001 #define UC_MCONTEXT_FPFMT_XMM 0x10002 #define UC_MCONTEXT_MC_LEN_VAL 0x320 -#elif defined(__sun) +#elif defined __sun #define UC_MCONTEXT_GREGS_R8 0x78 #define UC_MCONTEXT_GREGS_R9 0x70 #define UC_MCONTEXT_GREGS_R10 0x68 @@ -98,5 +98,5 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define UC_MCONTEXT_GREGS_RIP 0xc8 #define UC_MCONTEXT_FPREGS_MEM 0x120 #define FPREGS_OFFSET_MXCSR 0x18 -#define UC_SIGMASK 0x128 + #endif |