PERFORCE change 29331 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Apr 20 22:17:04 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=29331
Change 29331 by marcel at 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;
More information about the p4-projects
mailing list