Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Apr 2003 22:17:02 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 29331 for review
Message-ID:  <200304210517.h3L5H20t001205@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29331

Change 29331 by marcel@marcel_nfs on 2003/04/20 22:16:02

	Fix braino: the size of the register stack we need to copy is
	not the same as the size of the register stack we want to
	discard. We also don't need to handle the break based syscall
	patch any differently. While here, do some slight retyping to
	make it look slightly better.

Affected files ...

.. //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#15 edit

Differences ...

==== //depot/projects/ia64_epc/sys/ia64/ia64/machdep.c#15 (text+ko) ====

@@ -1072,11 +1072,11 @@
 exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
 {
 	struct trapframe *tf;
-	char *kstack;
-	uint64_t bspst, ndirty;
+	uint64_t bspst, kstack, ndirty;
+	size_t rssz;
 
 	tf = td->td_frame;
-	kstack = (char*)td->td_kstack;
+	kstack = td->td_kstack;
 
 	/*
 	 * RSE magic: We have ndirty registers of the process on the kernel
@@ -1094,16 +1094,15 @@
 	 * sure we mask-off the lower 9 bits of the bspstore value just
 	 * prior to saving it in ar.k6.
 	 */
-	if ((tf->tf_flags & FRAME_SYSCALL) == 0)
-		tf->tf_special.ndirty -= 24;
 	ndirty = tf->tf_special.ndirty & ~0x1ff;
 	if (ndirty > 0) {
 		__asm __volatile("mov	ar.rsc=0;;");
 		__asm __volatile("mov	%0=ar.bspstore" : "=r"(bspst));
-		bcopy(kstack + ndirty, kstack, ndirty);
+		rssz = bspst - kstack - ndirty;
+		bcopy((void*)(kstack + ndirty), (void*)kstack, rssz);
 		bspst -= ndirty;
 		__asm __volatile("mov	ar.bspstore=%0;;" :: "r"(bspst));
-		__asm __volatile("mov	ar.rsc=3;;");
+		__asm __volatile("mov	ar.rsc=3");
 		tf->tf_special.ndirty -= ndirty;
 	}
 	ndirty = tf->tf_special.ndirty;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304210517.h3L5H20t001205>