From 9897a5425ca38c2d1bd0c5c6bf308d569b6b1cb2 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 9 Aug 2003 13:44:39 +0000 Subject: [PATCH] Change the way we compute the top of the stack. This makes java-1.4.2 work. --- sys/miscfs/procfs/procfs_linux.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/miscfs/procfs/procfs_linux.c b/sys/miscfs/procfs/procfs_linux.c index 41b8c57c0478..3c35426ae329 100644 --- a/sys/miscfs/procfs/procfs_linux.c +++ b/sys/miscfs/procfs/procfs_linux.c @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_linux.c,v 1.10 2003/06/29 22:31:45 fvdl Exp $ */ +/* $NetBSD: procfs_linux.c,v 1.11 2003/08/09 13:44:39 christos Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.10 2003/06/29 22:31:45 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.11 2003/08/09 13:44:39 christos Exp $"); #include #include @@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.10 2003/06/29 22:31:45 fvdl Exp $ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.10 2003/06/29 22:31:45 fvdl Exp $ #include #include +#include #include #include @@ -124,7 +126,7 @@ procfs_do_pid_stat(struct proc *p, struct lwp *l, struct pfsnode *pfs, struct rusage *ru = &p->p_stats->p_ru; struct rusage *cru = &p->p_stats->p_cru; struct vm_map *map = &p->p_vmspace->vm_map; - struct vm_map_entry *entry, *last = NULL; + struct vm_map_entry *entry; unsigned long stext = 0, etext = 0, sstack = 0; if (map != &curproc->p_vmspace->vm_map) @@ -137,12 +139,13 @@ procfs_do_pid_stat(struct proc *p, struct lwp *l, struct pfsnode *pfs, if (stext == etext) { stext = entry->start; etext = entry->end; + break; } - last = entry; } - /* assume stack is the last entry */ - if (last != NULL) - sstack = last->start; + if (strcmp(p->p_emul->e_name, "linux") == 0) + sstack = LINUX_USRSTACK; + else + sstack = USRSTACK; if (map != &curproc->p_vmspace->vm_map) vm_map_unlock_read(map);