Date: Mon, 11 Jun 2018 15:43:28 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334954 - stable/11/sys/arm64/include Message-ID: <201806111543.w5BFhSHZ028305@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jun 11 15:43:28 2018 New Revision: 334954 URL: https://svnweb.freebsd.org/changeset/base/334954 Log: MFC r334101: Add GET_STACK_USAGE() for arm64. Modified: stable/11/sys/arm64/include/proc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/include/proc.h ============================================================================== --- stable/11/sys/arm64/include/proc.h Mon Jun 11 15:42:29 2018 (r334953) +++ stable/11/sys/arm64/include/proc.h Mon Jun 11 15:43:28 2018 (r334954) @@ -53,4 +53,18 @@ struct syscall_args { int narg; }; +#ifdef _KERNEL + +#include <machine/pcb.h> + +#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) + +#endif + #endif /* !_MACHINE_PROC_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806111543.w5BFhSHZ028305>