From owner-svn-src-stable@FreeBSD.ORG Mon Dec 30 00:43:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C33779CB; Mon, 30 Dec 2013 00:43:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE03D15E5; Mon, 30 Dec 2013 00:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBU0hOpT050006; Mon, 30 Dec 2013 00:43:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBU0hOr4050005; Mon, 30 Dec 2013 00:43:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201312300043.rBU0hOr4050005@svn.freebsd.org> From: Marius Strobl Date: Mon, 30 Dec 2013 00:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r260065 - stable/9/sys/sparc64/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Dec 2013 00:43:24 -0000 Author: marius Date: Mon Dec 30 00:43:24 2013 New Revision: 260065 URL: http://svnweb.freebsd.org/changeset/base/260065 Log: MFC: r255937 Implement GET_STACK_USAGE. Discussed with: mav Modified: stable/9/sys/sparc64/include/proc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sparc64/include/proc.h ============================================================================== --- stable/9/sys/sparc64/include/proc.h Sun Dec 29 23:46:59 2013 (r260064) +++ stable/9/sys/sparc64/include/proc.h Mon Dec 30 00:43:24 2013 (r260065) @@ -55,6 +55,17 @@ struct mdproc { #ifdef _KERNEL +#include + +/* Get the current kernel thread stack usage. */ +#define GET_STACK_USAGE(total, used) do { \ + struct thread *td = curthread; \ + (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \ + (used) = (char *)td->td_kstack + \ + td->td_kstack_pages * PAGE_SIZE - \ + (char *)&td; \ +} while (0) + struct syscall_args { u_int code; struct sysent *callp;