svn commit: r334954 - stable/11/sys/arm64/include

Mark Johnston markj at FreeBSD.org
Mon Jun 11 15:43:29 UTC 2018


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_ */


More information about the svn-src-all mailing list