This is the mail archive of the frysk-cvs@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] master: Fixup x86_64 setcontext libunwind merge.


The branch, master has been updated
       via  db12de6bd0cf944eea41c664b10231a1890e7fda (commit)
      from  f96c440e566a2a25d4011e061bc75e1ce98c378c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit db12de6bd0cf944eea41c664b10231a1890e7fda
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Thu Jan 31 10:56:46 2008 +0100

    Fixup x86_64 setcontext libunwind merge.
    
    2007-01-31  Mark Wielaard  <mwielaard@redhat.com>
    
            Fixup libunwind merge.
            * src/Makefile.am (libunwind_la_SOURCES_x86_64): Add
            x86_64/setcontext.S.
            * src/x86_64/Gresume.c (x86_64_local_resume): Call
            _x86_64_setcontext.
            * src/x86_64/setcontext.S: Added.

-----------------------------------------------------------------------

Summary of changes:
 frysk-imports/libunwind/ChangeLog                  |    9 +++
 frysk-imports/libunwind/src/Makefile.am            |    1 +
 frysk-imports/libunwind/src/x86_64/Gresume.c       |    2 +-
 .../src/{ia64/sigsetjmp.S => x86_64/setcontext.S}  |   68 +++++++++-----------
 4 files changed, 42 insertions(+), 38 deletions(-)
 copy frysk-imports/libunwind/src/{ia64/sigsetjmp.S => x86_64/setcontext.S} (53%)

First 500 lines of diff:
diff --git a/frysk-imports/libunwind/ChangeLog b/frysk-imports/libunwind/ChangeLog
index 36d38de..6ecc99c 100644
--- a/frysk-imports/libunwind/ChangeLog
+++ b/frysk-imports/libunwind/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-31  Mark Wielaard  <mwielaard@redhat.com>
+
+	Fixup libunwind merge.
+	* src/Makefile.am (libunwind_la_SOURCES_x86_64): Add
+	x86_64/setcontext.S.
+	* src/x86_64/Gresume.c (x86_64_local_resume): Call
+	_x86_64_setcontext.
+	* src/x86_64/setcontext.S: Added.
+
 2007-01-25  Mark Wielaard  <mwielaard@redhat.com>
 
 	Revert:
diff --git a/frysk-imports/libunwind/src/Makefile.am b/frysk-imports/libunwind/src/Makefile.am
index f6447ca..b245b15 100644
--- a/frysk-imports/libunwind/src/Makefile.am
+++ b/frysk-imports/libunwind/src/Makefile.am
@@ -189,6 +189,7 @@ libunwind_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common)	    \
 	$(libunwind_la_SOURCES_local)					    \
 	$(dwarf_SOURCES_local)						    \
 	dwarf/Lfind_proc_info-lsb.c					    \
+	x86_64/setcontext.S						\
 	x86_64/Lcreate_addr_space.c x86_64/Lget_save_loc.c x86_64/Lglobal.c \
 	x86_64/Linit.c x86_64/Linit_local.c x86_64/Linit_remote.c	    \
 	x86_64/Lis_signal_frame.c x86_64/Lget_proc_info.c x86_64/Lregs.c    \
diff --git a/frysk-imports/libunwind/src/x86_64/Gresume.c b/frysk-imports/libunwind/src/x86_64/Gresume.c
index 2fc51aa..4edc4da 100644
--- a/frysk-imports/libunwind/src/x86_64/Gresume.c
+++ b/frysk-imports/libunwind/src/x86_64/Gresume.c
@@ -71,7 +71,7 @@ x86_64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
     {
       Debug (8, "resuming at ip=%llx via setcontext()\n",
 	     (unsigned long long) c->dwarf.ip);
-      setcontext (uc);
+      _x86_64_setcontext (uc);
     }
 #else
 # warning Implement me!
diff --git a/frysk-imports/libunwind/src/ia64/sigsetjmp.S b/frysk-imports/libunwind/src/x86_64/setcontext.S
similarity index 53%
copy from frysk-imports/libunwind/src/ia64/sigsetjmp.S
copy to frysk-imports/libunwind/src/x86_64/setcontext.S
index 02f7af4..9eeb1b8 100644
--- a/frysk-imports/libunwind/src/ia64/sigsetjmp.S
+++ b/frysk-imports/libunwind/src/x86_64/setcontext.S
@@ -1,6 +1,6 @@
 /* libunwind - a platform-independent unwind library
-   Copyright (C) 2003-2004 Hewlett-Packard Co
-	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+   Copyright (C) 2007 Google, Inc
+	Contributed by Arun Sharma <arun.sharma@google.com>
 
 This file is part of libunwind.
 
@@ -23,47 +23,41 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
 
-#include "jmpbuf.h"
+#include "offsets.h"
 
-#define SIG_BLOCK 0
+	.global _x86_64_setcontext
 
-	.align 32
+_x86_64_setcontext:
 
-	.global __sigsetjmp
-	.global sigprocmask
+        /* restore fp state */
+	mov    REG_OFFSET_FPREGS_PTR(%rdi),%r8
+	fldenv (%r8)
+	ldmxcsr FPREG_OFFSET_MXCR(%r8)
 
-	.proc __sigsetjmp
+	/* restore the rest of the state */
+	mov    REG_OFFSET_R8(%rdi),%r8
+	mov    REG_OFFSET_R9(%rdi),%r9
+	mov    REG_OFFSET_RBX(%rdi),%rbx
+	mov    REG_OFFSET_RBP(%rdi),%rbp
+	mov    REG_OFFSET_R12(%rdi),%r12
+	mov    REG_OFFSET_R13(%rdi),%r13
+	mov    REG_OFFSET_R14(%rdi),%r14
+	mov    REG_OFFSET_R15(%rdi),%r15
+	mov    REG_OFFSET_RSI(%rdi),%rsi
+	mov    REG_OFFSET_RDX(%rdi),%rdx
+	mov    REG_OFFSET_RAX(%rdi),%rax
+	mov    REG_OFFSET_RCX(%rdi),%rcx
+	mov    REG_OFFSET_RSP(%rdi),%rsp
 
-__sigsetjmp:
-	.prologue
-	.save ar.pfs, r35
-	alloc loc1 = ar.pfs, 2, 3, 3, 0
-	add out2 = JB_MASK*8, in0
-	.save rp, loc0
-	mov loc0 = rp
-	mov out0 = SIG_BLOCK
-	.body
-	;;
-	cmp.ne p6, p0 = in1, r0
-	mov out1 = r0
-	mov loc2 = ar.bsp
-(p6)	br.call.sptk.many rp = sigprocmask // sigjmp_buf[JB_MASK] = sigmask
-	;;
+        /* push the return address on the stack */
+	mov    REG_OFFSET_RIP(%rdi),%rcx
+	push   %rcx
 
-	add r16 = JB_MASK_SAVED*8, in0
-	st8 [in0] = sp, (JB_RP-JB_SP)*8	// sigjmp_buf[JB_SP] = sp
-	mov r8 = 0
-	;;
-	st8 [in0] = loc0, (JB_BSP-JB_RP)*8	// sigjmp_buf[JB_RP] = rp
-	st8 [r16] = in1			// sigjmp_buf[JB_MASK_SAVED] = savemask
-	mov rp = loc0
-	;;
-	st8 [in0] = loc2		// sigjmp_buf[JB_BSP] = bsp
-	mov.i ar.pfs = loc1
-	br.ret.sptk.many rp
+	mov    REG_OFFSET_RCX(%rdi),%rcx
+	mov    REG_OFFSET_RDI(%rdi),%rdi
+	retq
 
-	.endp __sigsetjmp
 #ifdef __linux__
-	/* We do not need executable stack.  */
-	.section	.note.GNU-stack,"",@progbits
+      /* We do not need executable stack.  */
+      .section        .note.GNU-stack,"",@progbits
 #endif


hooks/post-receive
--
frysk system monitor/debugger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]