Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/irix sproc: Correctly interpret NULL stack and st...



details:   https://anonhg.NetBSD.org/src/rev/b4abab7d1caf
branches:  trunk
changeset: 526267:b4abab7d1caf
user:      manu <manu%NetBSD.org@localhost>
date:      Mon Apr 29 16:01:12 2002 +0000

description:
sproc: Correctly interpret NULL stack and stacklen when shared vm space is not
requested

diffstat:

 sys/compat/irix/irix_prctl.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (45 lines):

diff -r 51ff251b7fed -r b4abab7d1caf sys/compat/irix/irix_prctl.c
--- a/sys/compat/irix/irix_prctl.c      Mon Apr 29 15:45:05 2002 +0000
+++ b/sys/compat/irix/irix_prctl.c      Mon Apr 29 16:01:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_prctl.c,v 1.7 2002/04/28 19:42:13 manu Exp $ */
+/*     $NetBSD: irix_prctl.c,v 1.8 2002/04/29 16:01:12 manu Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.7 2002/04/28 19:42:13 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.8 2002/04/29 16:01:12 manu Exp $");
 
 #include <sys/errno.h>
 #include <sys/types.h>
@@ -200,17 +200,16 @@
        /* 
         * Setting up child stack 
         */
-       if (len == 0) 
-               len = p->p_rlimit[RLIMIT_STACK].rlim_cur;
-       if (sp == NULL) {
-               sp = (caddr_t)(round_page(tf->f_regs[SP]) 
-                   - IRIX_SPROC_STACK_OFFSET - len);
-               while (trunc_page((u_long)sp) >= 
-                   (u_long)p->p_vmspace->vm_maxsaddr)
-                       sp -= IRIX_SPROC_STACK_OFFSET;
-       }
+       if (inh & IRIX_PR_SADDR) {
+               if (len == 0) 
+                       len = p->p_rlimit[RLIMIT_STACK].rlim_cur;
+               if (sp == NULL)
+                       sp = (caddr_t)(round_page(tf->f_regs[SP]) 
+                           - IRIX_SPROC_STACK_OFFSET - len);
+                       while (trunc_page((u_long)sp) >= 
+                           (u_long)p->p_vmspace->vm_maxsaddr)
+                               sp -= IRIX_SPROC_STACK_OFFSET;
 
-       if (inh & IRIX_PR_SADDR) {
                bzero(&vmc, sizeof(vmc));
                vmc.ev_addr = trunc_page((u_long)sp);
                vmc.ev_len = round_page(len);



Home | Main Index | Thread Index | Old Index