Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/powerpc Record any stack growth. This fixe...



details:   https://anonhg.NetBSD.org/src/rev/b55309953363
branches:  trunk
changeset: 511764:b55309953363
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jun 26 13:00:18 2001 +0000

description:
Record any stack growth.  This fixes a serious problem with core dumps.
Without this change, coredumps will only contain one page of stack
regardless of how many pages of stack the process actually has.

diffstat:

 sys/arch/powerpc/powerpc/trap.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r d8f74eff3393 -r b55309953363 sys/arch/powerpc/powerpc/trap.c
--- a/sys/arch/powerpc/powerpc/trap.c   Tue Jun 26 12:46:56 2001 +0000
+++ b/sys/arch/powerpc/powerpc/trap.c   Tue Jun 26 13:00:18 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.47 2001/06/19 07:14:24 simonb Exp $ */
+/*     $NetBSD: trap.c,v 1.48 2001/06/26 13:00:18 matt Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -113,6 +113,7 @@
                                     : "=r"(user_sr) : "K"(USER_SR));
                                va &= ADDR_PIDX | ADDR_POFF;
                                va |= user_sr << ADDR_SR_SHFT;
+                               /* KERNEL_PROC_LOCK(p); XXX */
                                map = &p->p_vmspace->vm_map;
                        }
                        if (frame->dsisr & DSISR_STORE)
@@ -120,6 +121,14 @@
                        else
                                ftype = VM_PROT_READ;
                        rv = uvm_fault(map, trunc_page(va), 0, ftype);
+                       if (map != kernel_map) {
+                               /*
+                                * Record any stack growth...
+                                */
+                               if (rv == 0)
+                                       uvm_grow(p, trunc_page(va));
+                               /* KERNEL_PROC_UNLOCK(p); XXX */
+                       }
                        KERNEL_UNLOCK();
                        if (rv == 0)
                                return;
@@ -150,6 +159,10 @@
                rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(frame->dar),
                    0, ftype);
                if (rv == 0) {
+                       /*
+                        * Record any stack growth...
+                        */
+                       uvm_grow(p, trunc_page(frame->dar));
                        KERNEL_PROC_UNLOCK(p);
                        break;
                }



Home | Main Index | Thread Index | Old Index