From owner-freebsd-arch Sun Dec 23 6:26:27 2001 Delivered-To: freebsd-arch@freebsd.org Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by hub.freebsd.org (Postfix) with ESMTP id 0A1A337B405; Sun, 23 Dec 2001 06:26:25 -0800 (PST) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 16I9a3-0008CZ-0V; Sun, 23 Dec 2001 14:26:23 +0000 Received: from salmon.nlsystems.com (salmon [10.0.0.3]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id fBNEP8927725; Sun, 23 Dec 2001 14:25:08 GMT (envelope-from dfr@nlsystems.com) Date: Sun, 23 Dec 2001 14:24:35 +0000 (GMT) From: Doug Rabson To: Julian Elischer Cc: Poul-Henning Kamp , John Baldwin , , Alfred Perlstein Subject: Re: Kernel stack size and stacking: do we have a problem ? In-Reply-To: Message-ID: <20011223142258.V457-100000@salmon.nlsystems.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 20 Dec 2001, Julian Elischer wrote: > > > On Thu, 20 Dec 2001, Poul-Henning Kamp wrote: > > > > > A) We should probably implement > > int enough_stack() > > a full unoptimised but correct version would be: > > int > enough_stack(u_int needed) > { > caddr_t addr, addr2; > > if needed > KSTACK_PAGES * PAGESIZE return 0; > > /* catch stupid values */ > addr1 = &needed; > addr2 = (caddr_t)curthread->td_kstack + needed; > > return (addr1 > addr2) > } One thing to remember - ia64 has *two* stacks. One traditional stack grows from the top of the kstack region downwards and the other, the register stack, grows upwards from the base of the kstack region. Its not possible to have a truly MI implementation of enough_stack(). -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message